-2

Object Im have Object , but how can get keys + value in this (main : , weather : , clouds: , cors : , ... ) Im try use map but can't go next entry My demo Sorry im bad english . thanks alot

James H
  • 9
  • 1
  • 1
    Welcome to Stack Overflow! Can you please attach the code as code instead of an image? – nd03 Dec 03 '22 at 12:38

2 Answers2

1

Please, see here. This is how you get both the key and value of an object.

const foobar = {main: "hello", clouds = "world", cors: 1}
const keypairs = Object.entries(foobar);

//looping
keypairs.map(([key, value]) => { // do something });
sheepiiHD
  • 421
  • 2
  • 16
-1

just replace value with value.main/ value.weather and it will work

andd one thing cities.map() is not enough you dont need cities.list.map()

good luck!

neotrix
  • 47
  • 5