问题:
The new
keyword in JavaScript can be quite confusing when it is first encountered, as people tend to think that JavaScript is not an object-oriented programming language. 最初遇到JavaScript时, new
关键字可能会造成很大的混乱,因为人们倾向于认为JavaScript并非面向对象的编程语言。
- What is it? 它是什么?
- What problems does it solve? 它解决什么问题?
- When is it appropriate and when not? 什么时候合适,什么时候不合适?
解决方案:
参考一: https://stackoom.com/question/6uNe/JavaScript中的-new-关键字是什么
参考二: https://oldbug.net/q/6uNe/What-is-the-new-keyword-in-JavaScript