GithubHelp home page GithubHelp logo

display-a-list-practice's Introduction

Display a list practice

The goal here is to help you see web development the way experienced developers do: as a series of finite and repeatable tasks.

There are only so many things we do in an app.

Here is a list of the 10 major plain JavaScript patterns.

 Let's practice the 'display a list' and 'render function' patterns.

Scoring rubric: 2.5 point for each array displayed to the page.

  1. Goal: render 4 separate lists of things to the same index.html file. Minimally,
    • one list should be a list of string,
    • one should be a list of simple objects,
    • one should be a list of objects where one property is a nested object,
    • and one should be a list of objects where one property is an array.
    • A a stretch goal, feel free to make all of them arrays of deep objects (with array and nested object properties).
  2. Start with the list practice template repo.
  3. Repeat the following process 4 times, with 4 different domains, all in the same template:
    1. Come up with a domain for this data (lie 'dogs' or 'candies'). Let's assume you picked 'candies'.
    2. Rename 'array-one.js' to 'candies-data.js' or whatever. In that data file, create an array of at least 3 objects for that domain (each object should have at least 3 properties). The objects in the array should all have the same properties.
    3. Rename 'render-one.js' to 'render-candy.js' file for your candy array. For your array of objects, write a simple render function that accepts one object and returns a DOM elements. This function should return at minimum a div with two p tags. The outer div should have a css class of 'candy-item'.
    4. Then, in app.js import your array and render function and grab a container element from the DOM.
    5. Loops through your array, and for each object, render and appends a styled candy element to the container element you grabbed from the DOM.
    6. Note: do this process one array at a time. Do not write 4 arrays, then 4 render functions, etc. Please work through the first array, then the first render function, then the first display function.

display-a-list-practice's People

Contributors

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