conditional that checks if letter is lowercase javascript code example
Example 1: how to find if given character in a string is uppercase or lowercase in javascript
var str = S;
if (str == str.toUpperCase())
{
console.log(" Uppercase");
}
else
{
console.log("Lowercase");
}
Example 2: js if text contains lowercase
function hasLowerCase(str) {
return str.toUpperCase() != str;
}
console.log("HeLLO: ", hasLowerCase("HeLLO"));
console.log("HELLO: ", hasLowerCase("HELLO"));