when I was on my project, I accidentally named a array “name” like this
var name = ["abc","abc","abc","abc"];
it generated an inconsistency in my project because as I expected name[0] would yield the first abc, HOWEVER!, it gives me the first letter a!!!. I tried this array in Firefox console and it always gave my the array instead of a String which I got from typing this into Chrome console.
So I renamed the variable to be something else like this in Chrome again
var foo = ["abc","abc","abc","abc"];
And foo[0] gave me the first “abc”. Feel free to try this, I am guessing there is a problem with the naming “name”, but have no idea why. Thanks
At the top level
var nameis the same aswindow.name.window.nameis reserved, so Chromeconverts it to string implicitly.
Note that converting an array to a string just comma-separates it:
is: