Created
December 27, 2015 02:33
-
-
Save menicosia/cb4afffaec4b654bb570 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
var g = { a : 1, b : 2 } | |
function callBack (key, value) { | |
console.log("Callback called with key: " + key + "\nAnd value: " + value) ; | |
} | |
function doNothing (key, value, cb) { | |
true ; | |
console.log(key + ": doing nothing") ; | |
cb() ; | |
} | |
function doLoop () { | |
for (k in g) { | |
f = function () { | |
callBack(k, g[k]) ; | |
} | |
doNothing(k, g[k], f) ; | |
} | |
} | |
doLoop() ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment