Jump to content

JavaScript/Reserved words/new

From Wikibooks, open books for an open world
Previous: nativeReserved wordsNext: package

The new keyword

[edit | edit source]

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

[edit | edit source]
theArray=newArray();theDate=newDate("Jan 3 1962");theObject=newObject;
Previous: nativeReserved wordsNext: package
close