// 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實現(xiàn)上面兩個類
面試題兩則,求指教。。
翻過高山走不出你
2018-08-02 16:27:21