Skip to content

Instantly share code, notes, and snippets.

@lanrion
Created September 2, 2014 03:06
Show Gist options
  • Save lanrion/9ad77c25b827b6744b07 to your computer and use it in GitHub Desktop.
Save lanrion/9ad77c25b827b6744b07 to your computer and use it in GitHub Desktop.
JavaScript 中2个等号与3个等号的区别
一直挺纠结这个问题的。
首先,== equality 等同,=== identity 恒等。
==, 两边值类型不同的时候,要先进行类型转换,再比较。
===,不做类型转换,类型不同的一定不等。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment