Created
January 10, 2019 00:21
-
-
Save imskojs/17bc5b1f7979f45a0304d85026b1f328 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
// x is an Object object, not an array | |
var x = Object.create(Array.prototype) | |
// verify that x is definitely not an array | |
Array.isArray(x); // output: false | |
// but, x has array mehods like push | |
x.push('apple') | |
// seems to work just like an array | |
x[0] // output: 'apple' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment