753 Views
Dealing with numbers in JavaScript can be tricky. Received values don't always fall inside expected ranges; sometimes they're negative when you expect positive results. Sometimes they're not even cast as numbers. Dealing with these conditions, and converting strings into useful numerical results, often falls to s method - Math.abs() - and two functions: parseInt and parseFloat.
0 comments