js learning tips
While learning JavaScript, I found an interesting piece of code:
var x = 1; |
You might think the result is 1, but actually, in JavaScript, the result is 2, whereas in Java, it would be 1. Python does not have a “switch-case” construct. This is because JavaScript’s switch statement uses strict equality (===) without type coercion.
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 黑夜梦想家的网络日志!
评论