I am very confused by the behavior of this code in Chrome 59.0.3071.115:
var names = ["Cat 1", "Cat 2"];
console.log(names);
Prints an array object, but
var name = ["Cat 1", "Cat 2"];
console.log(name);
Prints a string "Cat 1, Cat 2".
Why is this happening?
source
share