Typescript uses types Remember that typescript uses types. If you compare a string and a number, they will not be equal. Make sure you cast your string as a number like so Number(inputString) or !Number.isNaN(+inputString) tags: typescript, angular