javascript中Object.create与new的不一样

new new配合构造函数使用,建立一个新对象。javascript //定义class var Person = function (firstName) { this.firstName = firstName; }; //定义method Person.prototype.sayHello = function() { console.log("Hello, I'm " + this
相关文章
相关标签/搜索