This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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