Foo.bar = () => { ... }
function Foo() { ... }
Foo.prototype.bar = () => { ... }
new Foo.bar(); (1)
new Foo().bar(); (2)
(1) can be understood as new (Foo.bar)()
(2)The actual execution is (new Foo()).bar() =>This does not comply with the operator precedence rules. Unary operator<Attribute extraction and calling function operator (. [] ())
迷茫2017-05-19 10:30:13
new new Foo()
跟成员访问 .bar
with parameter list has the same priority, from left to right.
new without parameter list new Foo
One level lower.