JavaScript Template Literals and Equality Operators

Benny Kang
Jul 13, 2021

--

Template Literals is ES6’s much better tool

Different but shows the same result

Equality Operators: == vs ===

== is called loose equality operator and it does type coercion

=== is called strict equality operator and it does not perform type coercion

When it is ==
Result

num == stringValue is true because the number it is holding is the same and does not care about the type

When is is ===
Result

num === stringValue is false because the number it is holding is the same but type is different

--

--

No responses yet