2 ms·
> The language designer saw fit to include both. === wasn't introduced until ECMAScript 3 in 1999, originally there was only == when the language was created i
by mrmr1993 7y ago
> The language designer saw fit to include both.
=== wasn't introduced until ECMAScript 3 in 1999, originally there was only == when the language was created in '95.
The accepted wisdom is to prefer the newer === in the interest of clarity and consistency. With ==, it's easy to forget about one of the types it overloads (e.g. string vs. number) when making changes to existing code, and correct-looking code may behave unexpectedly for one of these types.