Last active
June 28, 2017 06:08
-
-
Save jigewxy/ea9500fae205aeb95c7a40cf19337b6a to your computer and use it in GitHub Desktop.
JS Bin[Array-like object]// source http://jsbin.com/kalovug
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 x = {'5':'cliff', '6':'19', length:3}; | |
var y = Array.prototype.slice.call(x); | |
console.log(y); | |
// result: [undefined, "cliff", "19"] | |
var a = {'0':'cliff', '1':'19', length:4}; | |
var b = Array.prototype.slice.call(a); | |
console.log(b); | |
//result: ["cliff", "19", undefined, undefined] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Be aware of the relationship of properties in Number and its position in sliced output.