Giter VIP home page Giter VIP logo

array-methods-react's Introduction

Lab: Array Methods with React

With this lab we'll get a chance to practice looping through arrays in a React.

loops in the sky

We'll be using JavaScript's fancy array methods. These give us a lot of power to manipulate data in arrays and can be a lot of fun once you get the hang of it!

You'll mainly be using these three for today's exercise.

Other use array iterator methods

Setup

To set up the activity

  • Clone down this repo to your local machine.
  • Once cloned down cd into this repo with cd array-methods-react.
  • Run npm install to install all the necessary packages.
  • Run npm start to start of the app in the browser.

Familiarize Yourself w/ the Code

Take a look at the ./src/planetData.js file. The file contains an array of planet data.

Take a look at App.js. At the top of the file we're pulling in planetData. We'll be rendering this data in our App component. Familiarize yourself with the App component's render() method and the renderPlanets() method.

At the moment the App component is set up to render an array of <p> tags, one for each planet in the planetData array.

Solving Challenges

We've solved the first challenge for you as an example.

When ready, go ahead and comment out the renderPlanets() function for Challenge #1 and uncomment the function for Challenge #2.

Each challenge will have you display a different set of data to the page. For each challenge write some code using one of the JavaScript array iterator methods to return some JSX and display the desired output to the page.

Do your best to work through each challenge. If you've been stuck on any particular challenge for more than 20 minutes take a peek at the solution found in the solutions.md file.

array-methods-react's People

Contributors

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