js 버전별 추가된 기능 정렬es10 ~es2021 까지
ES10 Object.fromEntries Object.entries의 반대 기능입니다. Object.entries가 객체를 2차원 배열로 만들었다면, fromEntries는 다시 2차원 배열을 객체로 만들어줍니다. 배열 말고 Map같은 것도 지원합니다. Object.entries({ a: 'zerocho', b: ['hello'] }); // [['a', 'zerocho'], ['b', ['hello']]] Object.fromEntries([['a', 'zerocho'], ['b', ['hello']]]); // { a: 'zerocho', b: ['hello'] } Array.prototype.flat, Array.prototype.flatMap Array.prototype.flat 다중 배열을 펼..
2021. 7. 31.