find a word in sentence javascript no case sen code example
Example 1: compare string camelcase and lowercase javascript
str.toUpperCase() === str || str.toLowerCase() === str;
Example 2: compare string camelcase and lowercase javascript
function sameCase(str) {
return /^[A-Z]+$/.test(str) || /^[a-z]+$/.test(str);
}