One of how to write closure
JavaScript is very flexible language. It is possible to write in this manner. this code is function make_counter receives one argument, and return function which has no name receives one argument. At the end, it is return total of two arguments. I knew the second line can receive argument! JavaScript is interesting language.
var make_counter = function (count) { return function (n) { return count += n }; }; var gon = make_counter(4); gon(56);