-
Exploring closures in functions in depth
over 8 years ago
-
over 8 years ago
Hello entusias,
I just checked your code and i want to recommend you to pass one extra argument in first function which we contain the integer value to create other functions with this count. Suppose you created functions like below.
var myshort = function (arg1,count) { var arg = arg1; for(var i=0;i<count;i++){ return function(arg + i){ return $arg += $arg + count; } } } myshort('Welcome',2)("To")("Findnerd");
-
1 Answer(s)