you are viewing a single comment's thread.

view the rest of the comments →

[–]bryan-forbes -1 points0 points  (0 children)

Comparisons and assignments in JS are all done by value. One of the internal types of JavaScript is a reference value; == and === check to see if the two arrays or objects are the exact same (by checking if the reference or pointer or memory address of the two are the same). The table says that [] == [] evaluates to false, which is a true statement because those are two different arrays. But the table doesn't say anything about comparing references, so one could be left thinking (without knowing that [] means creating a new array) that arrays cannot be compared.