I would like to know if leaving an empty if statement for certain situations as:
else if(typeof console === 'undefined'){}
Just to have the code bypass the rest of the function It is an accepted and safe way to work or there are other recommendation practices for these cases?. Thank you.
From what information you’ve provided me, I can glean that the answer is “no”. It will work, but it’s bad style. If you would like to bypass the rest of the function, why not
return;or put most of the logic in theifstatement that pertains to it so that there is no bypassing at all?