js提取对象数组中的某一个属性

arrOld = [
  {name: "zhangsan", age: "18"},
  {name: "lisi", age: "20"},
  {name: "wangwu", age: "17"},
  {name: "zhaoliu", age: "19"}
]
arrOld.forEach(item => {
                    console.log(item.name);
                    console.log(item.age);
               })  

 

posted @ 2021-11-14 16:36  勤快的懒羊羊  阅读(2672)  评论(0编辑  收藏  举报