Skip to content

Constructor Quote by Eric Freeman

“Math is not a constructor, or even a function. It’s an object. As you know, Math is a built-in object that you can use to do things like get the value of pi (with Math.PI) or generate a random number (with Math.random). Think of Math as just like an object literal that has a bunch of useful…” quote by Eric Freeman
Download Open image
““Math is not a constructor, or even a function. It’s an object. As you know, Math is a built-in object that you can use to do things like get the value of pi (with Math.PI) or generate a random number (with Math.random). Think of Math as just like an object literal that has a bunch of useful properties and methods in it, built-in for you to use whenever you write JavaScript code. It just happens to have a capital first letter to let you know that it’s built-in to JavaScript.””

Eric Freeman

About This Quote

Source Book: Head First JavaScript Programming, 2014

Math in JavaScript is a built‑in object offering properties and methods, not a constructor function.

In simple terms: Math is an object with tools.

Key Takeaway

Use Math’s built‑in methods for calculations.

Themes

programming JavaScript math

Mood

educational technical

Type

programming instructional

When to use this quote

  • calculating pi
  • generating random numbers
  • data analysis
  • game development

Key Concepts

objects built‑in APIs

Questions to Reflect On

  • When should you write your own function?
  • What built‑in method simplifies your task?
A Different Perspective

Relying solely on Math may limit custom algorithms.

4.9 out of 5 (6 ratings)

More by Eric Freeman

Explore all 90 Eric Freeman quotes

More Constructor quotes

Browse all 0 Constructor quotes