从javascript中的对象列表中获取值

时间:2016-11-10 10:37:01

标签: javascript python

当我在控制台中打印时,我在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中进行循环循环并获得所需的值

0 个答案:

没有答案