destructuring

    [Vue] Vuex 시작하기 전에...

    [Vue] Vuex 시작하기 전에...

    🚗 ES6+ 에서 Obj를 간결하게 선언 const name = 'deok' const obj1 = { name: name, sayHello: function() { return `Hi my name is ${this.name}` } } const obj2 = { name, sayHello() { return `Hi my name is ${this.name}` } } obj1과 ob2는 완전히 같다. 🚓 객체의 비구조화(destructuring) const student = { name: 'deok', email: 'deok@deok.com', phone: '01012345678' } // 1번 // const name = student.name // const email = student.email /..