< JavaScript < Reserved words

The new keyword

The new keyword is an operator that creates an object without members, calls it's constructor function with itself as the this operator, which initialises the object.

Examples

  theArray = new Array();
  theDate = new Date("Jan 3 1962");
  theObject = new Object;
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.