Plural and singular array names in JavaScript
name
is a predefined getter/setter property of the window
object, and will always be a string data type. So when you assign to it, you are not assigning to a variable, but using a setter, which will convert the given value to a string.