Open mhaidarhanif opened 6 years ago
const PEOPLE = [ { id: 0, name: "Haidar", phoneNumber: "+62-8-1993-101010" }, { id: 1, name: "Hanif", phoneNumber: "+62-878-8055-1650" } ]; PEOPLE.forEach(({ name, phoneNumber }) => { console.log(name, phoneNumber); }); const MAPPED_DATA = PEOPLE.map(({ name, phoneNumber }) => { return { name: name, phone: phoneNumber }; }); console.log(MAPPED_DATA);