let text = 'This is a text to test'; let length = text.length console.log('Length is: ' + length + ' characters');
length property of a String object contains the length of the string, in UTF-16 code units. length is a read-only data property of string instances.
For an empty string,
length is 0.