JavaScript type conversion: (true && 1) vs (true | | 1)

后端 未结 6 1792
清酒与你
清酒与你 2020-12-09 17:31

JavaScript is non-strictly typed language as Java,for example.

As we know, it converts value of result dependently upon context:

\"2\" + \"3\" r

6条回答
  •  庸人自扰
    2020-12-09 18:27

    You're confusing casting (the * / + operators will do this) with logical evaluation (which &&, ||) do.

提交回复
热议问题