JavaScript 的 == 和 ===

前端技术 Jul 22, 2021

先讲个段子

== 在 JS 里像个任性的小孩。[] == ![] → true。因为 ![] 变 false,false 变 0,[] 变 '','' 变 0。=== 就简单多了。

Tags