E19: Experience Functional Programming (Part 2)

In this experience, you will continue to gain familiarity with Underscore.

As before, we’ll use a Hawaii Open Dataset providing Five Years of UH Degree Data. Here’s a screen image of this dataset:

As a reminder, here’s what the uhdata variable’s value looks like:

The WOD

Let’s continue the fun!

2. Create a fork of your previous practice WOD to use as a basis for this one.

3. Use the functions provided by the underscore package to implement the following two functions. Note that your solutions cannot include a for loop or an if statement!

4. totalDegreesByYear(data, year). This function can be passed uhdata and a year and returns the total number of degrees awarded in the passed year.

5. listCampuses(data). This function can be passed uhdata and returns an array containing all the campuses referenced in the passed dataset.

6. Press the “update” button to save your fiddle.

7. Stop your timer and record your time. Be sure to record it, because you will need your WOD time data when you write your technical essay.

Rx: < 9 min Av: 9 - 12 min Sd: 12 - 15 min DNF: 15+ min

Demonstration

Once you’ve finished trying the WOD for the first time, watch me do it.

Standard WOD Caveats

You’ll learn significantly less from watching me solve the WOD if you haven’t attempted the WOD yourself first.

While it’s an achievement to finish the WOD no matter how long it takes, you might experience “diminishing returns” if you work longer than the DNF time. Thus, it is usually strategic to stop working at the DNF time and watch my solution.

After watching my solution, I recommend that you repeat the WOD if you have not achieved at least Av performance. If so, be sure to:

• Create a new fiddle and don’t refer to your old one while resolving the problem.
• Don’t look at my screencast while you WOD; and

Feel free to keep trying until you make Rx if that’s of interest to you.

Submission Instructions

By the time and date indicated on the Schedule page, submit this assignment via Laulima.