GithubHelp home page GithubHelp logo

phase-1-array-filter-method-lab's Introduction

Using the Array Filter Method

Learning Goals

  • Practice using filter() to return matching results

Introduction

We've all probably had the experience of filtering a selection of choices online. When shopping for clothing, we might have selected a single size so that we can consider only the search results we need. Or when ordering food online, we could have customized our results to only show restaurants currently open or offering delivery in our neighborhoods. Since it's such a common need for a user, it's also a common function for a web programmer to run. Fortunately for us, JavaScript provides a built-in filter() method.

Use filter() to Return Matching Results

We have an array of drivers with various information. We need to write functions using the filter() method so that PickMeUp Taxi service employees can easily query the data. Run the tests to see what conditions need to be met by each function before you start writing JavaScript code.

You'll be writing three functions:

  • findMatching- This function takes an array of drivers' names 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' names 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 driver objects and a string as arguments. Each driver object has two properties: name and hometown. The function should return each element whose name property matches the provided string argument.

Remember the workflow:

  1. Install the dependencies using npm install.
  2. Run the tests using npm test.
  3. Read the errors; vocalize what they're asking you to do.
  4. Write code; repeat steps 2 and 3 often until a test passes.
  5. Repeat as needed for the remaining tests.

After you have all the tests passing, remember to commit and push your changes up to GitHub, then submit your work to Canvas using CodeGrade.

Resources

phase-1-array-filter-method-lab's People

Contributors

dependabot[bot] avatar drakeltheryuujin avatar jenmyers avatar jlboba avatar lizbur10 avatar maxwellbenton avatar sgharms avatar thuyanduong-flatiron avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phase-1-array-filter-method-lab's Issues

Not helpful, in fact, harmful

In speaking with some of my cohort mates, a few of us feel like these labs are often times constructed in a way that doesn't only not make sense, but also serves to detract from previous learnings.

I'd like to get some practice in more realistic fashion than having to interact with the index.test files, and while solution branches are often times helpful, other times they're harmful to the learning process I'm taking, because the logic for how the answers were derived is not evidently clear or explicable based on the way the material was taught in previous lesson modules.

I felt like I had a good understanding of how the filter() tool works, but after attempting this lab, I simply don't feel that way anymore.

After various attempts to code the solutions in, I sought out the answers by locating the solution branch, figuring it might help me understand what the logic was behind the correct code, but after attempting to decipher that level of detail, I simply haven't the slightest clue as to how the solutions were formulated.

The solutions in this particular instance, and in many other instances, just don't seem consistent with the way the material was taught in previous lessons. Furthermore, they incorporate too many intricacies and complexities that take away from the core fundamentals of the topic at hand (i.e. working with weirdly named arrays of names where one Bobby has an uppercase B and another bobby with a lower case b).

This has made for a very inefficient learning process, and I no longer intend to utilize lab assignments as a result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.