Created
July 27, 2016 14:52
-
-
Save krasnobaev/edc6c618e54bc30d94737e8f3945c9bd to your computer and use it in GitHub Desktop.
js issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FunctionArray(count) { | |
var arr = []; | |
for (var i = 0; i < count; i++) { | |
var t = {}; | |
t.i = JSON.parse(JSON.stringify(i)); | |
arr[i] = function () { | |
debugger; | |
alert(t.i); | |
}.bind(t); | |
} | |
return arr; | |
} | |
FunctionArray(100)[1](); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment