Function expressions help

So i have this in instructions :

const plantNeedsWater = function dayToWater (day) {
if ( day === '‘wednesday’ ) {
return true ;
} else {
return false
}
}

but what if i wanna input more days,can i use if else,and set the return to something other then boolean?

you mean else if? Yes, you could. But using switch would also be something worth considering.

you could. Depends on what you want to achieve with the expansion of the program.

1 Like

@stetim94 thanks,yeah i ment else if,and yeah i see how switch would simplify it even more