Skip to content

Instantly share code, notes, and snippets.

@dance2die
Last active April 28, 2018 21:44
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/b976e3f0bc110529b4affcd9826e8015 to your computer and use it in GitHub Desktop.
Save dance2die/b976e3f0bc110529b4affcd9826e8015 to your computer and use it in GitHub Desktop.
function containsDemo(shippedOrders, domesticOrders) {
const firstDomesticOrder = domesticOrders[0];
const equalityComparer = order => order.id === firstDomesticOrder.id;
const containsDomesticOrder = shippedOrders.some(equalityComparer);
WriteLine(`Is the first domestic order shipped? ${containsDomesticOrder}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment