You might not know these super handy Number methods yet.

The properties and methods on the Number type are not something that I work with every day, and it is one of the more looked up topics for me. It’s usually because of something that didn’t add up, like in the case of comparing floating-point numbers- which always surprises me, and I lose a few moments researching Number topics.

But they can be super helpful in providing an easy way to convert between bases (toString), adding currency type or adhering to a certain number format based on the locale someone might be visiting (toLocaleString)

Maximum and minimum values

Numbers in machines have a maximum and minimum size that that particular machine (in this case, the Javascript VM) can operate with. In Javascript, those min/max values are stored as constants on the Number type. It’s not obvious right away how and why to use them.

#beginner #programming #javascript #tutorial

Top essential Javascript Number Methods
1.45 GEEK