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

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -