Created
July 29, 2010 07:26
-
-
Save cms/497497 to your computer and use it in GitHub Desktop.
Besen `Array.prototype.slice` bug
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 slice = Array.prototype.slice, | |
arrayLike = {0: 'a', 1: 'b', 2: 'c', 3: 'd', length:4}, | |
a = slice.call(arrayLike), // undefined | |
b = slice.call(arrayLike, undefined); // the array as expected | |
print(a); // undefined | |
print(b); // "a,b,c,d" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment