Plural and singular array names in JavaScript

Viewed 943

I'm 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 the string "Cat 1, Cat 2".

Why is this happening?

1 Answers
Related