var err1 = Error('message');
var err2 = new Error('message');
What's the difference? Looking at them in the chrome console, they look identical. Same properties on the object and the same __proto__
chain. Almost seems like Error
acts like a factory.
Which one is correct and why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…