Skip to content

Instantly share code, notes, and snippets.

@sandrabosk
Created July 11, 2020 17:53
Show Gist options
  • Save sandrabosk/e67c18dd6fd72891e8996ccf796797a0 to your computer and use it in GitHub Desktop.
Save sandrabosk/e67c18dd6fd72891e8996ccf796797a0 to your computer and use it in GitHub Desktop.

Create a new component ProductsList and save in its state the given array of products. Display all the products (their name and price, not paying attention to the inStock property):

// ...
state = {
  products: [
    {
      _id: '34rg',
      name: 'iron hat',
      price: 11.99,
      inStock: false
    },
    {
      _id: '36gu',
      name: 'iron tshirt',
      price: 19.99,
      inStock: true
    },
    {
      _id: '97ux',
      name: 'iron coffee mug',
      price: 7.0,
      inStock: true
    }
  ]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment