I’m doing this exercise where you have to calculate the number of limes needed to get the juice. It needs a switch statement inside which takes out the first element of the “limes” array, (and that works flawlessly). Until i add the condition to count down the wedges: even if in the cases is specified to subtract a determined amount,
Tag: multiple-conditions
why does “Number” make the “else if” work here?
I have a task to play a little with if/else if. i don’t understand why, when I write my code like the example below, the “else if(age === 18)” part doesn’t work. it shows up as “undefined”. the other 2 work. But, when i add (Number(age) at all of them, it works. Why is that? why can i use 2/3