Slide 10
Slide 10 text
Higher order functions
> const list = Immutable.List([1,2,3,4,5,6,7,8,9,10]);
List [1, 2, 3, 4, . . ., 9]
> const list2 = list.filter(x => x % 2 === 0)
.map(x => x * 2);
List [4, 8, 12, 16]
> const sum = list2.reduce((acc, x) => acc + x);
40
> list
List [1, 2, 3, 4, . . ., 9]