Last active
October 9, 2016 02:25
-
-
Save sAbakumoff/efc8cf038f3be01e47f1dfa7f400f352 to your computer and use it in GitHub Desktop.
This file contains 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 a = new Array(1000*1000*1000 + 1); | |
a[0] = 'a'; a[110] = 'b'; a[900] = 'c'; | |
Object.getOwnPropertyNames(a); // ["0", "110", "900", "length"] | |
// in operator automatically converts the left part to string | |
110 in a; // true | |
15 in a; // false | |
a[15] = 'd'; | |
15 in a; // true | |
Object.getOwnPropertyNames(a); // ["0", "15", 110", "900", "length"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment