Skip to content
Advertisement

Tag: isnan

IsNaN shows other results

console output My IsNaN says “12ab” is a number but at the first Non-Number argument its the first non-number, i used the isNaN function twice so idk why it doesnt work Answer You’re not comparing the same values here: the first check (saveNumbers) tests isNaN(parseInt(“12ab”)) while the second tests isNaN(“12ab”). saveNumbers will parse “12ab” and return 12, which is a

Advertisement