I was trying to do a loop. However, when I input the required value (value is 1), I return me the alert part which I put in.
var ctp
if (NumberPasses === '1') {
ctp = 0.93
}
if (NumberPasses === '2') {
ctp = 0.90
}
if (NumberPasses === '3') {
ctp = 0.85
}
else return (
alert("Number of tube pass: Only 1, 2 or 3!")
)
So whenever I key in the value '1' or '2', it shows the "Number of tube pass: Only 1, 2 or 3!". However, when I key in '3', the loop accept the value and assign ctp = 0.85.
NumberPasses.. how are we supposed to help you? it might be potentially a int, and so the===fails for the typecheck