About 165,000 results
Open links in new tab
  1. JavaScript Object Constructors - W3Schools

    JavaScript has built-in constructors for all native objects: The Math() object is not in the list. Math is a global object. The new keyword cannot be used on Math. Did You Know? Use object …

  2. constructor - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · The constructor method is a special method of a class for creating and initializing an object instance of that class. Note: This page introduces the constructor syntax. For the …

  3. What is a Constructor in JavaScript? - GeeksforGeeks

    Sep 24, 2024 · A constructor in JavaScript is a special function that is used to create and initialize objects. When we want to create multiple objects with similar properties and methods, the …

  4. JavaScript Constructor Function - JavaScript Tutorial

    In this tutorial, you'll learn about the JavaScript constructor function and how to use the new keyword to create multiple similar objects.

  5. Constructor, operator "new" - The Modern JavaScript Tutorial

    The regular {...} syntax allows us to create one object. But often we need to create many similar objects, like multiple users or menu items and so on. That can be done using constructor …

  6. A Beginner’s Guide to Constructors in JavaScript: From ... - Medium

    Jan 25, 2024 · Syntax: A class constructor is defined using the constructor keyword inside a class. The constructor method can take parameters and is used to set up the properties of the class.

  7. oop - Constructors in JavaScript objects - Stack Overflow

    May 25, 2013 · Can JavaScript classes/objects have constructors? How are they created? Using prototypes: this.color = color; return this.color; Hiding "color" (somewhat resembles a private …

  8. JavaScript | Constructors - Codecademy

    Jul 24, 2021 · When defining a class in JavaScript, there is a special constructor method defined within it. Like the object constructor function, the constructor method can be defined with any …

  9. JavaScript Class constructor Method - W3Schools

    The constructor() method is a special method for creating and initializing objects created within a class. The constructor() method is called automatically when a class is initiated, and it has to …

  10. JavaScript Object Constructors - GeeksforGeeks

    Jan 18, 2025 · A constructor function is a special type of function in JavaScript that is used to create and initialize objects. Constructors are used with the new keyword to create instances …

Refresh