标签:
声明变量a
a = 1 || 100;
a = 0 || 100;
1、上述代码在JavaScript(弱类型的解释型语言)中,结果如下:
a = 1 || 100; //1
a = 0 || 100; //100
2、上述代码在C、Java等(强类型编译型语言)中,结果如下:
a = 1 || 100; //1
a = 0 || 100; //0
声明变量a
a = 1 && 100;
a = 0 && 100;
a = 0 && 1;
未完
标签:
原文地址:http://www.cnblogs.com/olafff/p/5132938.html