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"