Coder Social home page Coder Social logo

tjbender / js-advanced-first-class-functions-practice-lab-nyc-clarke-web-100719 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/js-advanced-first-class-functions-practice-lab-nyc-clarke-web-100719

0.0 1.0 0.0 64 KB

License: Other

HTML 27.06% JavaScript 72.94%

js-advanced-first-class-functions-practice-lab-nyc-clarke-web-100719's Introduction

First-Class Functions Practice Lab

Objectives

  1. Practice using forEach
  2. Practice using sort
  3. Practice using reduce

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 six functions:

  • logDriverNames() — Receives an array of driver objects and logs the name attribute of each driver to the console.
  • logDriversByHometown() — Receives an array of driver objects as the first argument and a location as the second argument. The function logs to the console the name attribute of each driver whose hometown matches the string passed in as the 'location' argument.
  • driversByRevenue() — Receives an array of driver objects and returns a new array of driver objects sorted by their revenue attribute from lowest to highest.
  • driversByName() — Receives an array of driver objects and returns a new array of driver objects sorted by their name attribute from A to Z. Here, you may have to use the String.prototype.localeCompare() method.
  • totalRevenue() — Receives an array of driver objects and returns the sum of the revenue earned by each driver.
  • averageRevenue() — Receives an array of driver objects and returns the average revenue earned by each driver.

Resources

View First-Class Functions Practice Lab on Learn.co and start learning to code for free.

js-advanced-first-class-functions-practice-lab-nyc-clarke-web-100719's People

Contributors

jeffkatzy avatar gj avatar aviflombaum avatar jmburges avatar

Watchers

James Cloos avatar

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.