I attempted to convert the code below into a ternary operator, but unfortunately ended up with an undefined result. Could someone please clarify where I made a mistake and advise on how to correct it properly? Thanks in advance.
const plantNeedsWater = function (day) {
/*if (day === 'Wednesday'){
return true;
} else {
return false;
}*/
(day === 'Wednesday') ? true : false
return
}
console.log(plantNeedsWater('Tuesday'));