javascript ๊ฐ์ฒด ํค ์ด๋ฆ ๋ณ๊ฒฝ
๊ฐ์ฒด ํค ์ด๋ฆ ๋ณ๊ฒฝํ๊ธฐ (๊ฐ์ฒด ๋ฐฐ์ด) map ์ธ์๋ก ๊ฐ์ฒด๋ฅผ ๊ตฌ์กฐ๋ถํดํ์ฌ ๋ค๋ฅธ ์ด๋ฆ์ผ๋ก ๋ณ๊ฒฝํ๊ณ ์๋ก์ด ๊ฐ์ฒด๋ก ๋ฆฌํดํ๋ค. let origins = [{ old1: 'origins[0].old1', old2: 'origins[0].old2', old3: 'origins[0].old3' }, { old1: 'origins[1].old1', old2: 'origins[1].old2', old3: 'origins[1].old3' }]; let results = origins.map(({ old1: new1, old2: new2, ...rest }) => ({ new1, new2, ...rest })); ๊ฐ์ฒด ํค ์ด๋ฆ ๋ณ๊ฒฝํ๊ธฐ (๊ฐ์ฒด) let origin = { old1: 'origins[0].old1', old2..
2022. 7. 8.