1var name1 = "Taylor Johnson";
2var name2 ="taylor johnson";
3
4//convert to lowercase for case insensitive comparison
5if(name1.toLowerCase() === name2.toLowerCase()){
6 //names are the same
7}
8
9
1const str1 = 'Bill@microsoft.com';
2const str2 = 'bill@microsoft.com';
3
4str1 === str2; // false
5str1.toLowerCase() === str2.toLowerCase(); // true
1const str1 = 'Bill@microsoft.com';
2const str2 = 'bill@microsoft.com';
3
4str1 === str2; // false
5
6// will return 0, means these two strings are equal according to `localeCompare()`
7str1.localeCompare(str2, undefined, { sensitivity: 'accent' });