Compare reduce arrays

Run Settings
LanguageJavaScript
Language Version
Run Command
const students = [ { id: 1, name: 'Иван', mark: 5 }, { id: 2, name: 'Петр', mark: 4 }, { id: 3, name: 'Василий', mark: 3 }, { id: 4, name: 'Владимир', mark: 5 }, { id: 5, name: 'Александр', mark: 2 }, ]; // 1 students.reduce((acc, item) => ({ ...acc, [item.id]: item }), {}); // 2 students.reduce((acc, item) => { acc[item.id] = item; return acc; }, {});
Editor Settings
Theme
Key bindings
Full width
Lines