const originalString = "Hello, World!";
const uppercaseStr = originalString.toUpperCase();

console.log(uppercaseStr); // 出力: "HELLO, WORLD!"

/* 👇 元の文字列は変更されません。 */
console.log(originalString); // 出力: "Hello, World!"
str.toUpperCase();
const number = 17; // 文字列ではない数値データ型

try {
    let result = number.toUpperCase(); // この部分でTypeErrorが発生
    console.log(result);
} catch (error) {
    console.error(error); // TypeError: number.toUpperCase is not a function
}
const str1 = "apple";
const str2 = "APPLE";

if (str1.toUpperCase() === str2.toUpperCase()) {
    console.log("2つの文字列は同じです。");
} else {
    console.log("2つの文字列は異なります。");
}

// 出力: "2つの文字列は同じです。"
const title = "web development";
console.log(title.toUpperCase()); // 出力: "WEB DEVELOPMENT"
const warningMessage = "keep out of reach of children";
console.log(warningMessage.toUpperCase());
// 出力: "KEEP OUT OF REACH OF CHILDREN"