const data = [ { name: 'a', value: 'b' }, { name: 'c', value: 'd' },];이런 형태의 데이터를{ "a": "b", "c": "d"}이렇게 만들고 싶을 때 ⬇️ const dataArr = data.reduce((acc, item) => { acc[item.name] = item.value; return acc;}, {});const jsonString = JSON.stringify(dataArr, null, 2);1. 배열 고차 함수인 reduce를 이용해 {a: 'b', c: 'd'} 형태의 객체로 먼저 변환2. JSON.stringify를 실행하여 JSON으로 변환 🔎 Array.prototype.reducereduce 메서드는 자신을..