I’m raising the question as seen from this Code Academy lesson. Thanks in advance for your explanations.
Hope this is not repeated too often.
——– Explanation from the lesson is added below —————-
You may have noticed we’ve used two types of equals thus far, the single equals (=) and the double or triple equals (==, ===). The single equals (=) assigns a variable, while the double and triple equals (==, ===) are used to check equivalence between values. Since == can have some odd behavior in JavaScript, it is almost always better to use ===.
Run this exercise to see what it does. It first sets the variable word to the string "this". Change the code so that word === "that" evaluates to true, and the console.log() command is run.
The triple equals
===returns true if both operands are the same type and have the same value.The double equals
==returns true if both operands can be coerced to the same type (following a specific set of rules) and have the same value after being coerced.So, some examples: