Math object contains static properties and methods for mathematically dealing with numbers or providing mathematical constants (
Math() constructor that creates math instances.
It might seem odd that
Math starts with a capitalized letter since you do not instantiate an instance of a
Math Properties and Methods
Math object has the following properties and methods:
Math Is Not a Constructor Function
Math object is unlike the other built-in objects that are instantiated.
Math is a one-off object created to house static properties and methods, ready to be used when dealing with numbers. Just remember, there is no way to create an instance of
Math, as there is no constructor.
Math Has Constants You Cannot Augment or Mutate
Many of the
Math.PI;). Do not confuse these property constants for constructor functions due to the capitalization of their first letter. They are simply object properties that cannot be changed.
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.Update me weekly
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post