Giter Club home page Giter Club logo

iterators_lab's Introduction

Iterators Lab

Functional Programming

Description

In the iterators lab we will be continuing our exploration of iterators and building a few more useful methods. These methods will belong to an Iterators namespace, which we discussed in class. We also will try to use various testing methods to verify that our code is working.

Phase-1

Research the following term and summarize your findings on it two to three sentences:

  • higher-order function

Pretending we implemented the following methods, update this README with a description of each of the following and an example you've created:

  • max: returns the highest number of a group. ex. Math.max(3,2,9) = 9
  • min: returns the lowest number of a group. ex. Math.min(3,2,9) = 2
  • each: runs a function on each array element. ex. array.forEach(function[])
  • map: creates a new array by running a function on each individual value within an array
  • filter: creates a new smaller array of elements that fit stated criteria from the provided array note
  • reduce: combines all values in an array and returns a single number note
  • reject: returns an object if the provided reason matches the function's promise note

Use the notes provided to help guide you explanation.

Phase-2

  • Write a test in the spec folder for min and implement it in the src/iterators.js folder. There is a test for a max method already if you'd like to use that as inspiration.

  • Re-implement the each function, but write the spec for it first. Continue this exercise with map and filter and write tests first!

Phase-3

Implement the remaining iterator methods in the namespace and add tests for each one of them. Make sure that they return the correct data as well as datatype, and implement tests for edge cases (empty arrays, negative numbers).

iterators_lab's People

Contributors

tlicata avatar tifs avatar elie avatar

Watchers

James Cloos avatar  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.