Created
September 19, 2013 11:35
-
-
Save glebcha/6622136 to your computer and use it in GitHub Desktop.
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
function do_smth_with_arguments(/* lots of arguments here */){ | |
var args = Array.prototype.reverse.call(arguments);//call array method whatever you like | |
for(var i=0; i<args.length; i++){ | |
alert(args[i]);//do whatever you want with each argument passed | |
} | |
}; | |
do_smth_with_arguments.apply(null, ['one','two','three']);//null points to 'this' context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment