How “==” works in JavaScript? [duplicate]

== is called comparison/equality operator, it compares 2 values, but not their data types so for example

1 == '1' will return true, for stricter comparison, use === which will compare the data types too so 1 === '1' will return false

Leave a Comment