2014年3月26日

js 三元运算符以及|| 和 && 测试

摘要: var a = '0';var b = a ? 'me':'hi';console.log(b);//false 有: undefined , 0, '', false,null//true 有:'0',[],{},' 'var a = ' ';var b = a || '为假的';console.log(b);//为假的,有: undefined , 0, '', false,null//原样输出的 有:'0',[],{},' 阅读全文

posted @ 2014-03-26 23:22 andydaopeng 阅读(671) 评论(0) 推荐(0) 编辑

导航