Skip to content

Instantly share code, notes, and snippets.

@dance2die dance2die/containsDemo.js
Last active Apr 28, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.