Date vs new Date in JavaScript

From the specs:

When Date is called as a function rather than as a constructor, it returns a String representing the current time (UTC).

and:

When Date is called as part of a new expression, it is a constructor: it initialises the newly created object.

So, new Date(...) returns an object such that obj instanceof Date is true, whereas Date(...) basically returns the same as new Date().toString().

Leave a Comment