Another use of ‘||’ and ‘&&’ operators in javascript.

1. Another useĀ of ‘&&’ operator Consider following javascript if statement i.e. invoke callback if there is one. [code language=”js”] if(callback){ callback(); } [/code] Same above task can achieved in js with ease as follows. [code language=”js”] callback && callback(); [/code] 2. Another use of ‘||’ operator Consider following javascript if …