JS代码如下:
/**
* JavaScript 短路运算
*
* @param
* @arrange (512.笔记) jb51.cc
**/
var something = 'xxxx';
console.log( true && something ); //-> 'xxx';
console.log( false && something ); //-> false
console.log( true || something ); // -> true
console.log( false || something ); //-> something
// 来自:编程之家 jb51.cc(jb51.cc)
原文链接:https://www.f2er.com/js/527673.html