Returns the character at the specified index.
📓 JavaScript Basics
Joins two or more strings and returns a new string.
Checks if a string contains the specified substring.
Returns the index of the first occurrence of a specified value.
Returns the index of the last occurrence of a specified value.
Extracts a section of a string and returns it as a new string.
Splits a string into an array of substrings.
Returns a portion of the string, starting at the specified index.
Returns a substring between two indexes.
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