Files
30-seconds-of-code/snippets/isLowerCase.md
2018-01-06 13:52:30 +02:00

314 B

isLowerCase

Checks if a string is lower case.

Convert the given string to lower case, using String.toLowerCase() and compare it to the original.

const isLowerCase = str => str === str.toLowerCase();
isLowerCase('abc'); //true
isLowerCase('a3@$'); //false
isLowerCase('Ab4'); //false