'==' 和有什么不一样?和'===='?
与任何类型的代码无关,只是一般而言?
Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
Not really relative to any type of code, just in general?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通常
===
也表示类型相等。所以:
usually
===
also represents equality of type.so:
===
是相同运算符;当两个操作数的值和类型相同时,它返回 true。==
是等于运算符;它不检查类型,只检查值。了解更多信息此处。
===
is the identical operator; it returnstrue
when both the value and the type of the two operands are the same.==
is the equal operator; it does not check types, just values.Read more here.
=== 比较变量的值以及类型
== 不比较类型
=== compares the value as well as type of variable
== doesn't compare type