During implementation you can use libraries like ramda, lodash, underscore, etc. For each exercise you have to write tests.
Link to presentation: Functional programming in Javascript
Implement forEach, map, filter, reduceRight and some using only reduce.
Using only currying and split make a function called "words" that returns a list of words in a string. Split function is in Ramda R.split or in lodash _.split or you can use any another function that works similar to JavaScript String split() method.
words('a b c'); // ['a', 'b', 'c']
Using only add and map functions create a function that increases every number in array.
function add(a, b) {
return a + b;
}
Make a function to find the smallest number in an array. Use only less function and one of the listed below functions: map
, filter
, reduce
.
function less(a, b) {
return a < b ? a : b;
}
Implement a recursive version of the flatMapDeep function. Implement a recursive version of the forEach function.
Using Web Service of "MusicBrainz project" do following tasks:
- Display average length of tracks in the release and in the every single disk. Link to data.
- Display album titles list with release date. Albums can not be of a type "compilation". The list should be sorted by the release date of the album. Link to data.
- Present the results in a fancy way! The better, the more points you will get.
- Additional task: try to get any additional/interesting information from the database using as many functions as possible from lodash or Ramda.
Using only reduce
implement functions: sum
, any
, max
, concat
. Extract the common parts of this, propose API, describe the structure of common parts.
We will evaluate the implementation of projects as follows:
- Code is written in a function style or not? Pure, pointfree, etc.
- Quality of tests.
- Team ingenuity.