본문 바로가기

Dev-/java script, jQuery, Ajax

ES6 상속

const parent = {
name: 'parentName',
func() {
console.log(this.name)
}
};

/** ES5 상속 */
const es5Child = Object.create(parent);

/** ES6 상속 */
const es6Child = {
__proto__: parent
};