Created
December 13, 2016 09:46
-
-
Save rafaelmaeuer/46bcd89778808531e0a7ce0c1d8dd9c2 to your computer and use it in GitHub Desktop.
Callback Function with Parameters
From http://stackoverflow.com/questions/3458553/javascript-passing-parameters-to-a-callback-function
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 tryMe (param1, param2) { | |
alert(param1 + " and " + param2); | |
} | |
function callbackTester (callback) { | |
callback (arguments[1], arguments[2]); | |
} | |
callbackTester (tryMe, "hello", "goodbye"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment