Created
September 6, 2019 03:57
-
-
Save masautt/bb551be4a59ef8080534cc91ca4785b8 to your computer and use it in GitHub Desktop.
How to check if string is all uppercase 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 isUpperCase(str) { | |
| return str === str.toUpperCase(); | |
| } | |
| let fname = "Marek"; | |
| let lname = "SAUTTER"; | |
| console.log(isUpperCase(fname)); // --> false | |
| console.log(isUpperCase(lname)); // --> true | |
| // https://stackoverflow.com/questions/17572873/how-can-i-check-if-a-string-is-all-uppercase-in-javascript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment