Below is my solution for this codewars challenge
function solve(s){
let upper = s.match(/[A-Z]/g);
let lower = s.match(/[a-z]/g);
if(upper && upper.length > lower && lower.length){
return s.toUpperCase();
}
return s.toLowerCase();
}
but it is coming up with the below error:
These are the tests performed:
describe(“Basic tests”, function(){
Test.assertEquals(solve(“code”),“code”);
Test.assertEquals(solve(“CODe”),“CODE”);
Test.assertEquals(solve(“COde”),“code”);
Test.assertEquals(solve(“Code”),“code”);
});
Basically it is has a problem converting to uppercase but not lowercase, but not sure why?