JavaScript Math object
Last updated
Last updated
JavaScript has a Math
object that simplifies our programming with built-in mathematical functions, such as:
random number generator (Math.random
)
trigonometric functions (Math.sin
, Math.cos
, Math.tan)
exponents and roots (Math.pow, Math.sqrt, Math.exp
)
extrema (Math.max
, Math.min
)
rounding (Math.round
,Math.ceil
, Math.floor
)
...and a lot more!
As mathematics in general is beyond the scope for these JavaScript notes, we can find a more complete documentation at !