I have an array of cars.
car = {
make: \"nissan\",
model: \"sunny\",
colour: \"red\"
};
How would I use underscore.js to grou
var data = [
{
"name": "jim",
"color": "blue",
"age": "22"
},
{
"name": "Sam",
"color": "blue",
"age": "33"
},
{
"name": "eddie",
"color": "green",
"age": "77"
},
{
"name": "Dheeraj",
"color": "blue",
"age": "25"
},
{
"name": "Suraj",
"color": "green",
"age": "25"
}
];
var result = _.groupBy(data,"color");
console.log(result);