Functional-Light JavaScript, v2

# Challenge 8: Culmination Exercise 2

This course has been updated! We now recommend you take the Functional-Light JavaScript, v3 course.

Check out a free preview of the full Functional-Light JavaScript, v2 course:
The "Challenge 8: Culmination Exercise 2" Lesson is part of the full, Functional-Light JavaScript, v2 course featured in this preview video. Here's what you'd learn in this lesson:

## In this challenge, students take all the concepts discussed in the course and use them to solve a coding exercise.

Get Unlimited Access Now

Transcript from the "Challenge 8: Culmination Exercise 2" Lesson

[00:00:00]
>> Kyle Simpson: So I want you to have some practice working with data structures that aren't just arrays, and also thinking about how do I make my code something that I can model? And that's EXERCISE 8. So before I turn you loose on it, I wanna set your expectation, I want you to understand what we're looking at.

[00:00:19] So let me pop up exercise eight for you.
>> Kyle Simpson: So first off I want you to spend a few minutes of this exercise actually familiarizing yourself with the stuff that I've provided. When you open up EX8 you'll notice that there has been quite a bit already provided to you.

[00:00:42] I provided to you some of our built-in utilities that we've talked about. Or when I say built-in, I mean things that would have been provided by libraries. I've provided you a curry, a compose, a pipe, and a binary. So I've provided those utilities to you already. We've already talked about them in this course, but I just dropped them in so you can use them.

[00:01:00] I've provided you down here several helpers that you don't need to go ahead and write yourself. Cuz you already know how to test for something odd, you know how to use reduce to do a summation across a list. I did that for you with list sum. So those are the parts I want you to think about in this exercise.

[00:01:19] In this exercise what I want you to think about is this code that's going on up here. What you'll notice is that I am calling a filter object, a map object, and a reduce object utility. So I'm doing a filter, map and reduce across an object. We've already implemented map objects so I'm giving that one to you.

[00:01:39] But I want you to implement filter object and reduce object. And moreover, once you've done that, the second part of this exercise, this is where the rubber really meets the road. Those three separate statements that exist there, you'll notice some things, there's actually a quite a bit of not point-free style going on.

[00:02:02] There's a bunch of functions that for example, line seven is a function where we get that list, and then it immediately passes in to some other function. So I want you to use the concepts that we've talked about throughout this course like currying, piping, restricting things with binary.

[00:02:21] Those utilities I provided you here, curry, compose, pipe, and binary, you need all four of those to do this exercise. And I want you to take the lines 7 through 17, and I want you to express them completely point free. And it's going to be a bit tricky, so we're gonna give you some time on this, but I want you to express this completely point free.

[00:02:44] And what I've provided to you in this file is all that you need to do that. So that's the spirit of exercise eight, relays designed to kind of put a cap stone on everything we've talked today so far.