In [10]:
toLowerCase()
Converts a string to all lowercase letters.
Code Snippets:
string.toLowerCase()
Example Uses:
// Example 1: Convert a single word
let word = "Hello";
let lowerWord = word.toLowerCase();
console.log(lowerWord); // Output: "hello"
// Example 2: Case-insensitive comparison
let userInput = "YES";
if (userInput.toLowerCase() === "yes") {
console.log("Confirmed!");
}
// Example 3: Normalize input for storage
let email = "User@Example.COM";
let normalizedEmail = email.toLowerCase();
console.log(normalizedEmail); // Output: "user@example.com"
Out[10]:
Summary Notes
📝 Notes
This is a text for summary