In this lab, we'll use the map
method to write functions that properly query our data.
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 withfirstName
andlastName
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 thename
andhometown
object attributes, not the strings"DRIVER"
or"HOMETOWN"
.
Please open a GitHub issue or pull-reqeust. Provide a detailed description that explains the issue you have found or the change you are proposing. Then "@" mention your instructor on the issue or pull-reqeust, and send them a link via Connect.
View Map Lab on Learn.co and start learning to code for free.
PHRG Map Lab