Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created March 4, 2018 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/3dbc0bbddf1c096dd4b4ca69187787d2 to your computer and use it in GitHub Desktop.
Save dance2die/3dbc0bbddf1c096dd4b4ca69187787d2 to your computer and use it in GitHub Desktop.
function someDemo(orders) {
const ordersMoreThanEqualToQuantity30Exists = orders.some(
order => order.quantity >= 30
);
WriteLine(
`Are there orders with quantity great than and equal to 30? ${ordersMoreThanEqualToQuantity30Exists}`
);
const ordersBeforeYear2018 = orders.some(
order => order.orderDate.getFullYear() < 2018
);
WriteLine(`Are there orders ordered before 2018? ${ordersBeforeYear2018}`);
const ordersWithIDGreaterThan100 = orders.some(order => order.id > 100);
WriteLine(`Do we have more than 100 Orders? ${ordersWithIDGreaterThan100}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment