Git Product home page Git Product logo

advanced-javascript-challenge-arrays-in-depth's Introduction

MFR Advance JS challenge: Arrays in depth

Description

This is a little exercise where you can live coding the solution and see in real-time the result and why is it failing.

How to use it

First of all, fork this repository, so you can work with in your own copy.

The main goal of this challenge is to solve all the exercises. Each one is a function that you can find in /exercise/code.js. You will se those functions to be empty, so your mission would be to write the code that will match the expected output.

Objective

You need to implement the following functions in `/exercise/code.js``:

  • getUniqueTypes
  • orderByPower
  • filterByType
  • getPokemonNamesForType
  • getTotalPokemonPowerForType
  • getTypeAggregatedInformation

To solve this exercise, you will need to use the array functions we have seen in class:

  • map()
  • filter()
  • reduce()
  • forEach()
  • ...

How can I know the expected output?

If you start the live server in the index.html file. you will have the following interface:

In this interface you will see each of the exercise to be solve. Each row is a and these functions have an input that are going to receive, and an expected output. When you press the Run! button, the function will be executed using the selected input, and will tell you if the result is correct or not, with the actual result so you can compare:

Wrong answer

Correct answer

The collection you are going to use is the following:

const POKEMONS = [
  { name: "Squirtle", type: "water", power: 20 },
  { name: "Pikachu", type: "electric", power: 50 },
  { name: "Charmander", type: "fire", power: 10 },
  { name: "Zapdos", type: "electric", power: 30 },
  { name: "Voltorb", type: "electric", power: 10 },
  { name: "Ponyta", type: "fire", power: 50 },
  { name: "Raichu", type: "electric", power: 40 }
];

advanced-javascript-challenge-arrays-in-depth's People

Contributors

bguzmanrio avatar

Watchers

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