Skip to content

Instantly share code, notes, and snippets.

@gtzilla
Created July 20, 2011 18:39
Show Gist options
  • Save gtzilla/1095598 to your computer and use it in GitHub Desktop.
Save gtzilla/1095598 to your computer and use it in GitHub Desktop.
/*
*
* 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