声明变量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;
未完
时间: 2024-11-05 22:35:44