Skip to content

Instantly share code, notes, and snippets.

@rohozhnikoff
Created December 15, 2014 22:31
Show Gist options
  • Select an option

  • Save rohozhnikoff/0e878c636f5c8013dc8b to your computer and use it in GitHub Desktop.

Select an option

Save rohozhnikoff/0e878c636f5c8013dc8b to your computer and use it in GitHub Desktop.
Array::filterMap
Array::filterMap = (predicate) ->
acc = []
for el, i in @
res = predicate(el, i)
acc.push(res) if res?
return acc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment