So I tried to change the code below into a ternary operator, but it gave me and undefined result. Please can someone explain to me where I went wrong and how to deal with it appropriately. T for thanks.
const plantNeedsWater = function (day) {
/*if (day === 'Wednesday'){
return true;
} else {
return false;
}*/
(day === 'Wednesday') ? true : false
return
}
console.log(plantNeedsWater('Tuesday'));