Favorites

JavaScript new Operator

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
new
JavaScript Other OperatorThis operator is supported by all modern browsers.
Updated 28th November 2026

The new operator creates an object from a class or constructor function, running its constructor to set it up.

Description

The new operator creates an instance of a class or constructor function. It creates a new object linked to the constructor's prototype, runs the constructor with this bound to that object, and returns it (unless the constructor returns a different object).

Classes must be called with new, and calling them without it throws a TypeError. Some built-ins, such as Symbol and BigInt, can't be used with new, and others such as String and Number create wrapper objects you rarely want. Inside a function, new.target tells you whether it was called with new.

When a class extends another, its constructor must call super() before using this, so the parent constructor can set up the object. You can leave out the parentheses when there are no arguments, new Date, but including them is clearer and avoids precedence surprises, such as new Date().getTime() working only because of the parentheses.

Properties

Operator
new
Category
Other
Precedence
17 (1 is lowest, 18 is highest)
Associativity
n/a

Syntax

new Constructor()
new Constructor(arg1, arg2, ...)

Example

class Point {
  constructor(x, y) { this.x = x; this.y = y; }
}
const p = new Point(2, 3);
console.log(p, p instanceof Point);
console.log(new Date(0).toISOString());
try { Point(1, 2); } catch (e) { console.log(e.name); }

Browser Support

The following information will show you the current browser support for the new operator. Hover over a browser icon to see the version that first introduced support for this operator.

This operator is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee