How to Use Text Processing with Strings

A String is simply a sequence of characters. There are different ways to create Strings – either as a string literal or as a String object using the String() constructor. Strings can be compared to an array of characters and are often accessed similarly. Understanding them is crucial as they play a significant role in input and manipulation within coding.

Instance properties

These properties are defined on String.prototype and shared by all String instances.

String.prototype.constructor

The constructor function that created the instance object. For String instances, the initial value is the String constructor.

These properties are own properties of each String instance.

length

Reflects the length of the string. Read-only.