var str = 'foobar';
console.log( str[4] );
prints:
a
This proves that string also acts like an array.Am i correct?
var str = 'foobar';
console.log( str[4] );
prints:
a
This proves that string also acts like an array.Am i correct?
You can't set characters at a specific index, so no, not really:
> var a = 'foo';
undefined
> a[0] = 'x'; // No warning, no error. It just silently fails.
"x"
> a
"foo"