Created
September 6, 2019 03:58
-
-
Save masautt/c7146f1f5daad173418ef871bc5343e8 to your computer and use it in GitHub Desktop.
How to check if string is all lowercase in JavaScript?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isLowerCase(str) { | |
return str === str.toLowerCase(); | |
} | |
let fname = "Marek"; | |
let lname = "sautter"; | |
console.log(isLowerCase(fname)); // --> false | |
console.log(isLowerCase(lname)); // --> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment