Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
*
* setTimeout can take more than 2 arguments. args > 2 will be passed to method in arg position 1
* setTimeout(myMethod, 10, "one", { "foo" : "bar" }
*
* */
function myMethod( param1, param2 ) {
console.log(arguments);
}
// myMethod will get "one" and {"foo":"bar"} passed in as args
setTimeout( myMethod, 1, "one", {"foo":"bar"} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.