function isUpperCase(str) {
return str === str.toUpperCase();
}
function isLowerCase(str) {
return str === str.toLowerCase();
}
var upperLowerString = "UpperLowerCasestring";
upperLowerString = [...upperLowerString];
var upperLowerStringToggled = upperLowerString.map(f => {
if(isUpperCase(f))
return f.toLowerCase();
else
return f.toUpperCase();
})
.reduce((a,b) => a+b);
console.log(upperLowerStringToggled);
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)