const students = [
{
"id": 1,
"student_name": "Kris",
"student_avatar": "adsndajkdsa.jpg",
"student_town": "Ульновск",
"flow": 1
},
{
"id": 2,
"student_name": "Poli",
"student_avatar": "adsndajksdsa.jpg",
"student_town": "Самара",
"flow": 1
},
{
"id": 3,
"student_name": "Deni",
"student_avatar": "adsndajksdsa.jpg",
"student_town": "Казань",
"flow": 2
}
];
такой массив надо отсоритировать по flow, то есть все с одинаковым flow положить в отдельное место {1: { 0: {id:1,....} 1:{id:2,...}}, 2:{id:3, ...} }
я пытаюсь с reduce что-то сделать, но никак не соображу...
хелп