javascript - Passing a function as argument -
here exemple :
function a(b) { b(); } function b() { alert("d"); } function c() { alert("e"); } a(c);//output e with fiddle : http://jsfiddle.net/yqes3/
how can fire real b function a?
if b function isn't global, , don't want use naming conventions, create additional function
function d() { b(); } and call 1 instead. still think should name argument , function else though, it'd create less confusion other person (this include future version of yourself) looking @ code.
Comments
Post a Comment