PrettyFlyForAFatGuy, 1 month ago why wouldn’t you just convert inline? (Number(input_val) === 2) Converting would mean you could use a switch statement with your example rather than an if else ladder <span style="color:#323232;">switch(Number(input_val)) { </span><span style="color:#323232;"> case 1: </span><span style="color:#323232;"> doTheFirstThing(); </span><span style="color:#323232;"> break; </span><span style="color:#323232;"> case 2: </span><span style="color:#323232;"> doTheSecondThing(); </span><span style="color:#323232;"> break; </span><span style="color:#323232;"> case 3: </span><span style="color:#323232;"> doTheThirdThing(); </span><span style="color:#323232;"> break; </span><span style="color:#323232;">} </span>
why wouldn’t you just convert inline? (Number(input_val) === 2)
(Number(input_val) === 2)
Converting would mean you could use a switch statement with your example rather than an if else ladder
<span style="color:#323232;">switch(Number(input_val)) { </span><span style="color:#323232;"> case 1: </span><span style="color:#323232;"> doTheFirstThing(); </span><span style="color:#323232;"> break; </span><span style="color:#323232;"> case 2: </span><span style="color:#323232;"> doTheSecondThing(); </span><span style="color:#323232;"> break; </span><span style="color:#323232;"> case 3: </span><span style="color:#323232;"> doTheThirdThing(); </span><span style="color:#323232;"> break; </span><span style="color:#323232;">} </span>