GithubHelp home page GithubHelp logo

jacksonmchugh / u1_lab_es6_practice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from niasiac/u1_lab_es6_practice

0.0 0.0 0.0 8 KB

Get some practice in with the new tools we've picked up with ES6!

JavaScript 100.00%

u1_lab_es6_practice's Introduction

ES6 Practice

Fear

Homework Overview

We'll get some practice in with the new tools we've picked up with ES6!

Getting Started

  • Fork and Clone
  • Put your answers to the questions in this readme in the solutions.js file

Part 1 - Spreading Out

  1. Define two arrays, evens and odds filled with even and odd numbers.
  2. Using the spread operator, make a new array numbers that contains all of the evens and odds.

Part 2 - Merging Objects

  1. Define an object faveFoods that has keys representing three of your favorite foods and the values should be the restaurant or locale where they are from.
  2. Now make another object and do the same thing but this time ask your neighbor what their three favorite foods are. Literally. Go next door and ask them (jk that might not be safe, just pretend you know your neighbor - her name is Janet. very kind. lets you know that it is your other neighbor that is the smoker, not her. ok, Janet, we believe you.).
  3. Using the spread operator, build a final object allFoods with the items from faveFoods and janetFaveFoods together.

Part 3 - Destructuring

  1. Define yourself in a javascript Object with three keys: name, age, and hometown.
  2. Use the destructuring syntax to extract all three keys into variables. Log all three variables.
  3. Now we are going to give you a pet. Use destructuring to do the following: 1) add a pet object to your person, 2) define three variables (age, breed, name) outside of the object and 3) add those variables to your pet.
  4. Log the most important thing about you: your pet's name.

Resources

u1_lab_es6_practice's People

Contributors

ahonore42 avatar anpato avatar ben-manning avatar nobodyslackey 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.