Created
January 30, 2018 10:14
-
-
Save haingdc/f69437735850c1ff3b73cd691d10a5c6 to your computer and use it in GitHub Desktop.
close affect
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
var result = []; | |
for (var year = 0; year < 5; year++) { | |
result.push(function () { return year }); // (1) | |
} | |
console.log(result[1]()); // 5 (không phải 1) | |
console.log(result[3]()); // 5 (không phải 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment