how to compare strings in javascript ignoring case sensitive

JavaScript
const str1 = '[email protected]';
const str2 = '[email protected]';

str1 === str2; // false
str1.toLowerCase() === str2.toLowerCase(); // true
Source

Also in JavaScript: