0

I have an object in javascript as below when I print it in console.

 >>recent_projcts
 Array[2]
 0: Object1: Object
     id: 39
     name: "sample1"
 1: Object2: Object
     id: 40
     name: "sample2"

its similar to list of dictionary in python

[
  {'id':39,'name':'sample1'},
  {'id':40,'name':'sample2'}
]

How can I get only the id's in a variable. In general I need to know how to do loop in javascript for list and get required values

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Naggappan Ramukannan
  • 2,564
  • 9
  • 36
  • 59

0 Answers0