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

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

/* 👇 The original string remains unchanged. */
console.log(originalString); // Output: "Hello, World!"
str.toUpperCase();
const number = 17; // A number, not a string

try {
    let result = number.toUpperCase(); // A TypeError occurs here
    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("The two strings are the same.");
} else {
    console.log("The two strings are different.");
}

// Output: "The two strings are the same."
const title = "web development";
console.log(title.toUpperCase()); // Output: "WEB DEVELOPMENT"
const warningMessage = "keep out of reach of children";
console.log(warningMessage.toUpperCase());
// Output: "KEEP OUT OF REACH OF CHILDREN"