Does parseInt returning 12 mean the whole input was a valid count?
TechnologySomeone entered “12chairs” in my practice form's count box. My JavaScript used `parseInt(value, 10)`, got 12 and accepted it. I expected the letters to make the conversion fail.
MDN says parseInt can stop at a character that isn't valid for the chosen base and return the number parsed before it. MDN's parseInt reference
Should I define and check the accepted input before converting it? The field is supposed to contain a whole count, not a number with an arbitrary note after it. I don't want a successful conversion to silently choose what the person meant.