8.4 String

2010-04-13

A string is sort of an array of 16bit unsigned integers. A string is immutable. That is, if you have a reference to a string and you somehow “change” it, you’re guaranteed to have two different string objects in the back. So a string never “changes”.

Each integer represents a code point in the Unicode table. Unicode is a huge set of characters and every character has its own code point. This makes it possible to refer to every character in a universal way (by number).

Internally, they can be represented in any way that is convenient to the vendor that implements it. This means a string does not have to be stored as a string internally, but Ecmascript should not be able to detect this.