Created
January 27, 2019 23:04
-
-
Save Chuloo/1060aad132280d8d09ed366123edfb1c to your computer and use it in GitHub Desktop.
Filter numbers greater than 5
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
// We have an array with numbers | |
const numbers = [2, 4, 6, 8, 32, 100] | |
// Create function to filter any array | |
const functionToFilterNumbers = function(number){ | |
return number > 5; | |
} | |
// Filter the 'numbers' array | |
const filtered = numbers.filter(functionToFilterNumbers) | |
//Display filtered array | |
console.log(filtered) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment