Understanding why we use `===` in JavaScript

Understanding why we use `===` in JavaScript

Often in JavaScript you’ll see a developer use === in their conditionals instead of ==. Most languages will use single equals for assignment and double equals for comparison, JavaScript is no exception here. This third variation of triple equals is included in JavaScript and sees to cause the most confusion for developers and it turns for a very good reason. Triple equals is most often included in loosely typed languages such as JavaScript and PHP. A language like Ruby also has triple equals but it is used in a different way. ...

February 20, 2017 · 3 min · Nick Hayden