Notice
Recent Posts
Recent Comments
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

Día de Ruru

20230411 TIL 본문

항해99/TIL

20230411 TIL

공대루루 2023. 4. 12. 01:49

알게된 것

1. 객체 합치기 Object.assign()

const A = {
  name: 'Bella', 
  age: 32, 
};

const B = {
  email: 'test@test.com', 
  address: 'Seoul', 
};

const result = Object.assign({}, A, B);

2. 객체로 이루어진 배열의 정렬

const browsers = [
    { name: 'Chrome', year: 2008 },
    { name: 'Firefox', year: 2004 },
    { name: 'Safari', year: 2003 },
    { name: 'Opera', year: 1996 },
    { name: 'IE', year: 1995 },
    { name: 'Edge', year: 2015 }
];
 
browsers.sort((x, y) => x.year - y.year);

'항해99 > TIL' 카테고리의 다른 글

20230414 TIL  (0) 2023.04.15
20230413 TIL  (0) 2023.04.13
20230410 TIL  (0) 2023.04.11
20230406 TIL  (0) 2023.04.07
20230405 TIL  (0) 2023.04.06
Comments