0

about function

function groupById(array) { return array.reduce((obj, value) => { obj[value.id] = value; return obj; }, {}) } i want to known after return obj; {}) what is this?

10th Feb 2021, 6:41 AM
Lokesh Rathi
Lokesh Rathi - avatar
2 Respuestas
+ 1
empty object literal used as initial value of reduce accumulator (obj argument of callback function)
10th Feb 2021, 6:54 AM
visph
visph - avatar
+ 1
Lokesh Rathi You posted same question twice delete that
10th Feb 2021, 8:32 AM
R🍁🇮🇳
R🍁🇮🇳 - avatar