Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for All Upper II by Elena_Korljukova
import assert from "assert";
function isAllUpper(text: string): boolean {
return text.toUpperCase() == text && text.replace(/[^a-zA-Z]/g, '').length > 0;;
}
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(''), false);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
July 26, 2020