问题
In javascript, the typical way to new up an object is by doing it like this: new Date(). But you can also do this: new (Date). What is the difference and advantages of doing it the latter way?
回答1:
There is no difference.
The new operator takes a function reference.
Like any other operator, the operand can have parentheses.
The () after a new expression with no arguments are optional.
However, if you have more a complicated expression inside the parentheses, they can change precedence ordering, such as in this answer.
回答2:
I believe the latter way is identical to the first way. I think it will be interpreted as new Date since there is nothing to evaluate in the parentheses. Note that new Date is equivalent to new Date().
来源:https://stackoverflow.com/questions/8236058/what-is-the-difference-between-newdate-and-new-date