How to compare case insensitive strings in JavaScript
To compare a case insensitive strings, we can use either the toUpperCase() or toLowerCase() methods in JavaScript.
Comparision Using toUpperCase
const str1 = "heLLo viEwer loAd";
const str2 = "HELLO viewer load";
console.log(str1.toUpperCase() === str2.toUpperCase());Output:
trueComparison using toLowerCase
const str1 = "heLLo viEwer loAd";
const str2 = "HELLO viewer load";
console.log(str1.toLowerCase() === str2.toLowerCase());Output:
true

