当我在控制台中打印时,我在javascript中有一个对象。
>>recent_projcts
Array[2]
0: Object1: Object
id: 39
name: "sample1"
1: Object2: Object
id: 40
name: "sample2"
类似于python中的字典列表
[
{'id':39,'name':'sample1'},
{'id':40,'name':'sample2'}
]
如何才能在变量中只获取id。一般来说,我需要知道如何在javascript中进行循环循环并获得所需的值