DEANO.ME

parseint

 

Here’s a strange one for you… We all know that parseInt() is a really useful function for converting a string into an integer. It enables us to take a string, convert it to a number, perform mathematic equations and get the result we are looking for. However today I was converting some strings into numbers […]

 

parseInt() is an incredibly useful function which is available in some form in all programming languages, however in JavaScript there is one slightly annoying difference… Unlike in other languages which either throw an error or just assume 0 when a string cannot be converted to an integer, parseInt() returns “NaN” which means “Not-a-Number”. This is […]

+1
Tweet
Share
Share
Stumble
Pin
Email
Shares 0