Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
var str = 'foobar'; console.log( str[4] ); prints: a
这证明字符串也像数组一样。我正确吗?
您不能在特定索引处设置字符,所以不,不是:
> var a = 'foo'; undefined > a[0] = 'x'; // No warning, no error. It just silently fails. "x" > a "foo"