

To perform a case-insensitive check, convert both the string and the character to lowercase before calling includes() on the string. const str = 'Bread and Milk' const char1 = 'd' const char2 = 'p' console.log(str.includes(char1)) // true console.log(str.includes(char2)) // false Tip The includes() method returns true if the string contains the character, and false if it doesn't. To check if a string contains a particular character, we can call the includes() method on the string, passing the character as an argument e.g., str.includes(char). In this article, we’ll be looking at different ways to quickly check if a string contains a specific character in JavaScript.
