Created
March 11, 2011 03:29
-
-
Save miguelrios/865405 to your computer and use it in GitHub Desktop.
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 array = []; | |
console.log("my array has " + array.length + " elements and it looks like: ", array); | |
console.log("WTF?"); | |
array[5] = 1; | |
console.log("now my array has " + array.length + " elements and it looks like: ", array); | |
console.log("Okey..."); | |
/* | |
results from Chrome-Safari console: | |
my array has 0 elements and it looks like: [undefined, undefined, undefined, undefined, undefined, 1] | |
WTF? | |
now my array has 6 elements and it looks like: [undefined, undefined, undefined, undefined, undefined, 1] | |
Okey... | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment