Created
February 15, 2018 16:15
-
-
Save bmorelli25/051e9ea6fea7bdd91bfaa35cd9823988 to your computer and use it in GitHub Desktop.
Count Occurrences
This file contains hidden or 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
| const countOccurrences = (arr, val) => arr.reduce((a, v) => (v === val ? a + 1 : a + 0), 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment