Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
AUI - SLR - Split, Every, Match, RegEx solution in Clear category for All Upper I by Taylor_Page
import assert from "assert";
//const isAllUpper = (text: string): boolean => text.split("").every(val => val.match(/[A-Z|\s|\d]/g))
function isAllUpper(text: string): boolean {
return text.split("").every(val => val.match(/[A-Z|\s|\d]/g))
}
console.log('Example:');
console.log(isAllUpper('ALL UPPER'));
// These "asserts" are used for self-checking
assert.equal(isAllUpper('ALL UPPER'), true);
assert.equal(isAllUpper('all lower'), false);
assert.equal(isAllUpper('mixed UPPER and lower'), false);
assert.equal(isAllUpper(''), true);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
April 27, 2020
Comments: