Last active
February 6, 2019 17:11
-
-
Save Chuloo/f792890d0a8ec4f3340d0e7dd27c6aa0 to your computer and use it in GitHub Desktop.
Check if each item in an array is less than 100
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
// Create new array | |
const array = [20, 21, 23, 15, 2] | |
// Create condition | |
const isLessThan100 = (number)=> number < 100 | |
// Apply function | |
let result = array.every(isLessThan100) | |
// Output result | |
console.log(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment