Working with Numbers in JavaScript

Nikhil Swain
May 12, 2019 · 5 min read

Numbers and mathematics come into most scripts at some point, be it in the form of the simple arithmetic required to add up prices and work out sales tax, the process of generating and using random numbers, or the more complex mathematics involved animation.
In this article we’ll meet the basic constructs for number crunching in JavaScript, and look at some fairly simple, but useful snippets.