Hello guys, I hope you are well, I hope you can help me, I am trying to do the Vehicle Purchase exercise, in the second problem which is "Choose between two potential vehicles to buy" it does not give me the expected result, I already used the method " length ", but I still receive the expected result, then I leave you my code
function chooseVehicle(option1, option2) {
if(option1.length > option2.length){
return option1 + " is clearly the better choice.";
}else if(option1.length < option2.length){
return option2 + " is clearly the better choice.";
}else{
return 'none';
}
}
console.log(chooseVehicle('Wuling Hongguang', 'Toyota Corolla'));
// => 'Toyota Corolla is clearly the better choice.'
// => 'Volkswagen Beetle is clearly the better choice.'