GithubHelp home page GithubHelp logo

array-map-filter's Introduction

map and filter exercises

FRENCH VERSION (a bit less detailed)

Installation

  • First of all, fork this repo (button in the upper-right corner)
  • You'll then be redirected to the copy created on your account, of which you must get the URL, in order to clone it on your computer.
  • If you cloned the repo instead of forking, don't panic, instructions are given at the end to get you back on your feet (but next time... read the instructions first ๐Ÿ˜‰)
  • Once you've cloned the repo locally, navigate to its folder (cd array-map-filter),
  • Run npm install (this will install the automatic testing tools)

Usage

This repo uses an automatic testing tool. Once you've performed all the installation steps, run npm test (after ); your screen should look like this:

No tests enabled

At the bottom of the screen, you can see "0 passing", and on the next line "7 pending". This means the 7 tests are deactivated, which is intended: otherwise your screen would be filled with unfriendly error messages in red.

Activating a test

When you start working on an exercise, you have to enable the test for that exercise. For example if you start working on filter/ex1.js, run this (Windows users, please use Git Bash and not the regular Windows terminal):

./enable filter 1

Now if you run npm test again, you should see something like this:

One test enabled

The "statistics" at the bottom have just changed: the test for filter/ex1.js is now running, but it's failing with this message:

AssertionError: expected undefined to deeply equal [ 7, 2, 0, 3, 11 ]

Now, what does that mean? It means that the test called the function defined in filter/ex1.js, and expected a result (the array on the right). Since the function is empty, it received a different result (undefined).

When you solve the exercise, the "failing" test should be replaced with a "passing" test when you run npm test.

Now, solve them all!

There are two series of three exercises each: one inside map, one inside filter. You can do them in any order.

Run npm test each time you think you made a step forward in solving an exercise (making sure you did save your .js file).

Don't hesitate to use console.log along the way, to print the values of variables as you're attempting to solve the exercises.

HELP! I cloned before forking!

  • Don't panic: you still can fork the repo
  • To link your local repo to the remote repo (your fork), you have to edit .git/config (which you may do with nano under Linux, MacOS, or Windows with Git Bash).
  • In this file, under the line [remote "origin"], replace WildCodeSchool with your own GitHub username in the URL: https://github.com/WildCodeSchool/array-map-filter.

array-map-filter's People

Contributors

ashleighmorehattia avatar bhubr avatar

Watchers

 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.