I do have an array of objects and I want to create a filter function to return an new array
var items = [{
"row": 0,
"column": 0,
"items": [2, 3, 4, 5, 6, 7]
}, {
"row": 0,
"column": 1,
"items": [8, 9, 10, 11, 12, 13]
....
{
"row": 2,
"column": 2,
"items": [50, 51, 52, 53, 54, 55]
}]
var newArray = function (items, row) {
//filter items and return new array
return filtered
}
newArray should contain all values from 'items' that have the same row value.
_.groupBy(items, "row")items, but also each item contains a property nameditems