It's easy in Javascript to know how many characters are in a string using the property .length. The length property returns the number of characters in the string, including spaces and special characters.

let size = "Our lovely string".length;
// size: 17

let emptyStringSize = "".length
// emptyStringSize: 0

The length property of an empty string is 0.

The length property is a read-only property, so you cannot assign a new value to it.

results matching ""

    No results matching ""