EqualityOperatorComparesOnlyTypes
DRAFT
Not Observed

Misconception:

() = () compares only the types of the two operands.

Incorrect

() = () compares only the types of its operands

Correct

() = () compares the values of its operands

Correction
Here is what's right.

The () = () operator compares the values of its operands.

While the following block, with operands of different types (the first a string, the second a number) evaluate to false

the following block also evaluates to false; the two operands have the same type, they are numbers, but they have different values:

Origin
Where could this misconception come from?

NOTE — We are not aware of repeated observations of this misconception in Scratch. We documented it, for completeness, based on observations of an equivalent misconception in other languages.

In JavaScript there are different equality operators (== and ===), and the difference in their semantics has something to do with the types of their operands.

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.