Giter Site home page Giter Site logo

arrays-object-practice's Introduction

arrays-object-practice

Fork and Clone this repo

  1. Create a index.js file.
  2. This is a solo assignment. Be sure to work through these problems on your own.

Problem 1

You have an array called numbers with three elements: [1, 2, 3]. Destructure the array into three separate variables: first, second, and third, and assign the corresponding values. Print the value of second.

Problem 2

Consider the following object:

const person = {
  name: 'John',
  age: 30,
  city: 'New York'
};

Using destructuring, extract the values of name and city from the person object and store them in variables called personName and personCity, respectively. Print the values of both variables.

Problem 3

You have an object called car with the following properties:

const car = {
  brand: 'Toyota',
  model: 'Corolla',
  year: 2022
};

Use Object.keys to extract the keys of the car object into an array called keysArray. Print the keysArray.

Problem 4

Using Object.values, extract the values from the car object defined in the previous problem and store them in an array called valuesArray. Print the valuesArray.

Problem 5

Using Object.entries, extract both the keys and values from the car object defined earlier and store them in an array called entriesArray. Print the entriesArray.

arrays-object-practice's People

Contributors

jo-well29 avatar domosayshello 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.