Expand Minimize

Always supply a radix with parseInt

You must always supply a radix with parseInt, as some valid values will be shown as NaN (Not a Number)

CheckId SPC058912
TypeName AlwaysSupplyRadixWithParseInt
Severity Warning
Type JavaScriptFile

Bad Practice

var f = parseInt('10')

Good Practice
// Base 10 example if radix with parseInt
var f = parseInt('10', 10)

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.