Map Lab

Overview

In this lab, we'll use the map method to write functions that properly query our data.

Instructions

Be sure to run the tests to get a feel for the types of problems this lab is asking you to solve.

You'll be writing three functions:

  • lowerCaseDrivers - this function takes an array of drivers, and returns an array of the drivers names in lowercase.
  • nameToAttributes - this function takes an array of drivers with their first and last name separated by a space, and returns an array of JavaScript objects with firstName and lastName attributes.
  • attributesToPhrase - this function takes an array of drivers as JavaScript objects and returns a string saying "<NAME OF DRIVER> is from <HOMETOWN>" for each JavaScript object in the array. Note that between the < and > we are looking for the value stored in the name and hometown object attributes, not the strings "DRIVER" or "HOMETOWN".

Resources

View Map Lab on Learn.co and start learning to code for free.