Last active
September 27, 2017 09:32
-
-
Save ferreiratiago/088396b05141fb66fa22507b476f78f5 to your computer and use it in GitHub Desktop.
JS WTF
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 example = { length: 3 } // An array-like object | |
// When executing 'Array.apply(null, example)' | |
// Array will be executed with its arguments being the properties' values from 0...length - 1 | |
Array(example[0], example[1], example[2]) | |
// Which translates into | |
Array(undefined, undefined, undefined) // [ undefined, undefined, undefined ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment