GoConqr has a new look! Let us know what you think.

Flashcards

Destructuring

milly larcen Destructuring English 4 cards

Cards in this deck (4)

  1. 1object destructuringvar obj ={color: "blue"}
    console.log(obj.color);
    ***
    var { color, name} = { color: "blue", name: "John", city: "NY"}
    console.log(color);
  2. 2function destructuringfunction generateObj(){
    return { color: "blue", name: "John", city: "NY"}}
    var {name, color} = generateObj();
    console.log(color);
  3. 3arrayvar [first,,,,fifth] = [red, blue, green, black, orange];
    console.log(first);
  4. 4array of objectsvar people = [
    { color: "blue", name: "John", city: "NY"},
    { color: "red", name: "Mary", city: "LA"}]
    people.forEach(
    ({color, name}) =>
    console.log(color, name)
    )
    **
    var [,red] = people;
    function logColor({name}){
    console.log(name);}
    logColor(red);

Information

Description
Destructuring Flashcards on Destructuring, created by milly larcen on 07/05/2020.
Created by
milly larcen
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?