javascript - calling function and ignoring callback parameter -


i want call this:

function fwc(a, b, callback) {  dosomestuff(a,b); callback(); } 

with this:

fwc (a,b); 

sometimes need callback , don't. can cause trouble when call function , ignore callback?

if can't change fwc function, can call :

fwc(a, b, function(){}); 

this way there won't error when fwc tries call third argument.

if can change it, change

function fwc(a, b, callback) {     dosomestuff(a,b);     if (callback) callback(); } 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -