Last active
October 12, 2015 18:34
-
-
Save sarfraznawaz2005/78efda875550fa2ecaab to your computer and use it in GitHub Desktop.
Object to Array
This file contains hidden or 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
// simple way to convert an object to an array with all butter of array using Array.slice | |
function foo(a, b, c){ | |
var argsArray = [].slice.apply(arguments); | |
argsArray.push(4,5); | |
alert(argsArray[4]); //5 | |
} | |
foo(1, 2, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment