Filter Lab

Overview

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

Instructions

This lab contains an array of drivers with various information. We need to write methods using the filter method so that Scuber employees can easily query the 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:

  • findMatching- This function takes an array of drivers and a string as arguments, and returns the matching list of drivers. The function should be case insensitive.
  • fuzzyMatch - This function takes an array of drivers and a string as arguments for querying the array, and returns all drivers whose names begin with the provided letters.
  • matchName - This function takes an array of drivers and a string as arguments. In this function, each element of the drivers array is a JavaScript object that has a property of name. The function should return each element whose name property matches the provided string argument.

Resources

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