string.length
let x = "Hello";
console.log(x.length); // 5

let strJP = "コーディングエブリバディ";
console.log(strJP.length); // 12 

let emptyStr = ""; // 空の文字列
console.log(emptyStr.length); // 0

/* lengthプロパティの値には「空白文字(スペース)」も含まれます。 */
let str = "Hello World";
console.log(str.length); // 11 ("Hello" 5 + " " 1 + "World" 5)

let spaces = "   "; // 3つの空白文字
console.log(spaces.length); // 3
let str = "a"; // 単一のコードユニット
console.log(str.length); // 1

let japanese = "あ"; // 単一のコードユニット
console.log(japanese.length); // 1

let emoji = "😊"; // 2つのコードユニットで表現される <== 注意点
console.log(emoji.length); // 2
let str = "Hello, World!";
console.log(str.length); // 13

// lengthプロパティの変更を試行
str.length = 5;

console.log(str.length); // 依然として 13
console.log(str);        // "Hello, World!" のまま維持される