There are two ways to access an individual character in a string. The first is the charAt method:return 'cat'.charAt(1); // returns "a"
The other way is to treat the string as an array-like object, where individual characters correspond to a numerical index:return 'cat'; // returns "a"
For character access using bracket notation, attempting to delete or assign a value to these properties will not succeed. The properties involved are neither writable nor configurable.
So if you want to use the array accessor with a string, there is a way to do it, but it requires a bit of overhead.