ES6 - Propriété de longueur de chaîne

Cette propriété renvoie le nombre de caractères dans une chaîne.

Syntaxe

string.length

Exemple: propriété de constructeur de chaîne

var uname = new String("Hello World")
console.log(uname)
console.log("Length "+uname.length) // returns the total number of characters // including whitespace

Production

Hello World
Length 11