Both are fine; this is explicitly stated in the specification:
… Thus the function call
Error(…)
is equivalent to the object creation expressionnew Error(…)
with the same arguments.
Both are fine; this is explicitly stated in the specification:
… Thus the function call
Error(…)
is equivalent to the object creation expressionnew Error(…)
with the same arguments.