How to map JavaScript array to multidimensional array based on item property?
I have an array of objects such as this: var arr = [ {name:"item1", category:0}, {name:"item2", category:3}, {name:"item3", category:1}, {name:"item4", category:1}, ] I want to produce a multi-dimensional array based on category values such as this: (We can assume fixed…