A Pen by Jeremiah Biard on CodePen.
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
| var f = []; | |
| function factorial (n) { | |
| if (n == 0 || n == 1) | |
| return 1; | |
| if (f[n] > 0) | |
| return f[n]; | |
| return f[n] = factorial(n-1) * n; | |
| } |
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
| function complement(A, B) { | |
| return A.filter(function(elem) { return B.indexOf(elem) == -1; }); | |
| } | |
| function unique(arr) { | |
| return arr.filter(function(elem, pos) { | |
| return arr.indexOf(elem) == pos; | |
| }); | |
| } |
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
| return newReleases.filter(function(movie) { | |
| return (movie.rating === 5.0); | |
| }).map(function(movie) { | |
| return movie.id; | |
| }); |
NewerOlder