Skip to content
字数
69 字
阅读时间
1 分钟
js
const students = [

  { name: 'Nick', grade: 10 },

  { name: 'John', grade: 15 },

  { name: 'Julia', grade: 19 },

  { name: 'Nathalie', grade: 9 }

];

let obj = {}

for (let i = 0; i < students.length; i++) {

  obj[i] = students[i];

  for (let key in obj) {

    if (obj.hasOwnProperty(key)) {

      console.log(obj[key])

    }

  }

}

贡献者

The avatar of contributor named as sunchengzhi sunchengzhi

文件历史

撰写