Skip to content

Instantly share code, notes, and snippets.

@kluu1
Last active March 20, 2020 02:06
Show Gist options
  • Select an option

  • Save kluu1/3457ca094a35cb641fdc126561c3c5fb to your computer and use it in GitHub Desktop.

Select an option

Save kluu1/3457ca094a35cb641fdc126561c3c5fb to your computer and use it in GitHub Desktop.
const orders = [
{
orderId: 5563,
total: 673.33
},
{
orderId: 5564,
total: 274.99
},
{
orderId: 5565,
total: 130.98
},
{
orderId: 5566,
total: 1018.19
},
{
orderId: 5567,
total: 928.79
},
{
orderId: 5568,
total: 478.89
}
];
const largeOrders = orders.filter(order => {
return order.total > 600;
});
console.log(largeOrders);
/*
[{ orderId: 5563, total: 673.33 },
{ orderId: 5566, total: 1018.19 },
{ orderId: 5567, total: 928.79 }]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment