Skip to content

Instantly share code, notes, and snippets.

@cms
Created July 29, 2010 07:26
Show Gist options
  • Save cms/497497 to your computer and use it in GitHub Desktop.
Save cms/497497 to your computer and use it in GitHub Desktop.
Besen `Array.prototype.slice` bug
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