Files
30-seconds-of-code/snippets/isUpperCase.md
Isabelle Viktoria Maciohsek 27c168ce55 Bake date into snippets
2021-06-13 13:55:00 +03:00

436 B

title, tags, firstSeen, lastUpdated
title tags firstSeen lastUpdated
isUpperCase string,beginner 2018-01-06T11:16:05+02:00 2020-09-15T16:28:04+03:00

Checks if a string is upper case.

  • Convert the given string to upper case, using String.prototype.toUpperCase() and compare it to the original.
const isUpperCase = str => str === str.toUpperCase();
isUpperCase('ABC'); // true
isUpperCase('A3@$'); // true
isUpperCase('aB4'); // false