Last active
June 4, 2016 13:49
-
-
Save nowk/3938ad25d0b6cce60277 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fn(function(val) { | |
console.log(val); | |
}, function(val) { | |
console.log(val); | |
}); | |
// foo | |
// bar | |
/* | |
* fn | |
* | |
* @param {Function} cb | |
*/ | |
function fn(cb) { | |
cb('foo'); | |
var overloadfn = arguments[1]; | |
if ('function' === typeof overloadfn) { | |
overloadfn('bar'); | |
} | |
} |
This file contains hidden or 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
fn(function(val) { | |
console.log(val); | |
}, function(val) { | |
console.log(val); | |
}); | |
// bar | |
// foo | |
/* | |
* fn | |
* | |
* @param {Function} cb | |
*/ | |
function fn(cb) { | |
setTimeout(function() { | |
cb('foo'); | |
}, 100); | |
var overloadfn = arguments[1]; | |
if ('function' === typeof overloadfn) { | |
overloadfn('bar'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment