// ES5var randy = new Person('Randy', 1995)console.log(randy) // => {name: "Randy", birth: 1995}randy.say('Hello') // => 'Randy: Hello'// es6var randy = new Person('Randy', 1995)console.log(randy) // => {name: "Randy", birth: 1995}randy.say('Hello') // => 'Randy: Hello'console.log(randy.age) // => 22randy.birth = 1998console.log(randy.age) // => 19分别用es5跟es6实现上面两个类
添加回答
举报
0/150
提交
取消