Same approach as Poetro's, just a slightly different implementation:
function buildList(list) {
var arrFun = new Array();
for(var x = 0; x < list.length; x++) {
arrFun[x] = (function (y) {
return function () {
alert(" NUMBER "+list[y]);
}
})(x);
}
return arrFun;
}
Like I said, same thing, I just find this idiom fits into my head slightly
more easily :)
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]