Do you know what will be the output of this code?
JavaScript
console.log([1, 2, 3] == "1,2,3");
Show answer and explanation
The answer is true.
When an object is compared to a string with ==, it’s converted to a primitive. An array’s toString() joins its items with commas, giving "1,2,3".