Chapter 19. The Math, Number, Boolean, and Array Objects
In this chapter, we’ll take a look at the Math
, Number
, Boolean
, and Array
JavaScript objects. Except for the Boolean
object, we’ve seen all these objects already, but we’ve never taken a systematic look at them and listed all their properties and methods. We’ll do that in this chapter, starting with the Math
object.
The Math Object
The Math
object gives you access to powerful math routines, such as log
, sqrt
, and pow
(which raises values to various powers). We’ve already seen the Math
object in the book every now and then when we had to round off numbers or find absolute values. You can see ...
Get Inside JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.