In addition to the existing comments about optional parentheses -- i.e. new Date() <==> new Date
-- note also that Date.now
is a static method. That is, no Date
object is ever instantiated. The method is a property of the Date
constructor itself. In this way, it is different than the other two examples.
As a matter of style, I prefer including all optional parens for consistency and clarity:
(new Date()).getTime()