반응형
Notice
Recent Posts
Recent Comments
Link
반응형
목록설정 (1)
반응형
taenyLog
[JavaScript] Destructuring 객체 분해
순서를 따르지 않는다. 배열 구조 분해보다 실용적임. 사용자 정보 중 몇가지 특성에 접근하거나 선정해야 하는 경우 유용 // 예제 객체 const person = { firstName: 'John', lastName: 'Doe', age: 30, city: 'New York' }; // 객체 분해 const { firstName, lastName, age, city } = person; // 분해한 값 출력 console.log('나이:', age); console.log('도시:', city); console.log('이름:', firstName); console.log('성:', lastName); // 변수 이름 변경 const {city : country} = person; > country < ..
Web
2023. 9. 26. 11:14