Skip to main content

Constructor Functionfunction to programmatically create Object (& link via __proto__ after Instantiation with new)

aka Constructor, Constructor-fn, Global-Constructor

!cannot use arrow function since it does not have it's own this keyword

All object literals are Syntactic Sugar for Constructor Functions

{...} === new Object(...)`

called with new JS Operator

References

  1. Static MethodMethod attach to Constructor Function (NOT Delegate via __proto__)

  2. instanceofJS Operator to return boolean if __proto__ (of Constructor Function) exists on calling Operand's prototype chain

  3. newJS Operatorto call Constructor Function, assign this keyword & link to Prototype

  4. naming convention for [**_Constructor Function_**](constructor-function) ↔ start with Capital letter

  5. @constructorJSDoc tag to mark function as Constructor Function

  6. __proto__[[ ]] property on all objects, link to Constructor Function

  7. RegExp()Constructor Function for new RegExp Object

  8. ErrorConstructor for generic Error Object

  9. InstanceObject created through a class or Constructor Function

  10. Private ConstructorConstructor Function prepend with private to restrict access to within class, prevent Instantiation with new

  11. ErrorConstructor for generic Error

  12. URL()Constructor to return new URL

  13. WebSocketInterface Object & Constructor to access WebSockets API

  14. Set()Constructor to convert iterable arg to set

  15. FunctionGlobal Constructor for new function Object

  16. DateInterface Constructor for new date object (with epoch)

  17. Map()Constructor to Instantiate new map Object

  18. classJS Keyword to declare Class (as Syntactic Sugar over Constructor Function)