ignore case sensitive in javascript code example
Example 1: compare string camelcase and lowercase javascript
str.toUpperCase() === str || str.toLowerCase() === str;
Example 2: js ignore case
var str = "Visit W3Schools!";
var patt1 = /W3S/i;
var res = patt1.ignoreCase
Example 3: compare string camelcase and lowercase javascript
function sameCase(str) {
return /^[A-Z]+$/.test(str) || /^[a-z]+$/.test(str);
}