I have a JSON array object as follows:
{
orderId: 1,
firstName: John,
lastName: Smith,
address: {
street: 123 Main Street,
city: New York,
zip: 10001
}
},
{
orderId: 2,
firstName: John,
lastName: Smith,
address: {
street: 123 Main Street,
city: New York,
zip: 10001
}
}
And I am trying to use underscore.js to create a new array object, grouped by the address to meet the use case to display all orders that have been shipped to 123 Main Street, New York, 1001.
Is underscore.js the right approach to do this? If so, how should I do so? Any hints will be helpful.
Aucun commentaire:
Enregistrer un commentaire