Skip to content

Instantly share code, notes, and snippets.

@hayk94
Created September 29, 2017 05:39
Show Gist options
  • Save hayk94/71ae6c93d434f72412ff3d027f549171 to your computer and use it in GitHub Desktop.
Save hayk94/71ae6c93d434f72412ff3d027f549171 to your computer and use it in GitHub Desktop.
Count Elements in the array
function countElemInArray (array, elemToCount) {
return array.filter(elem => elem === elemToCount).length
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment