Created
July 30, 2016 21:56
-
-
Save visualjeff/a37ea04650e8a4de2a3a8953f09b0cd4 to your computer and use it in GitHub Desktop.
Javascript's Higher Order Functions and Ember's Higher Order functions
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
Higher order functions: | |
.forEach() - Iterates over a set | |
.map() - Projects a set | |
.filter() - Narrows down a set based on the predicate | |
.find() - Returns the first match in a set based on the predicate | |
.any() - Returns true if match is found based on the predicate | |
.every() - Returns true if match is found for all elements in the set (predicate also) | |
Stop using switch, for and while loops! | |
Ember's higher order functions: | |
.mapBy() - Pass in name of field | |
.filterBy() - Pass in value names of the field and value to match | |
.findBy() - Pass in vale names of the field and value to match | |
.isAny() - Pass in value name of the field and value to match | |
.isEvery() - Pass in value name of field and value to match | |
Search the Ember api for "ember.enumerables" to view them all. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment