forEach遍历对象数组案例

<script>
var users = [
{name:'name1',age:21},
{name:'name2',age:22},
{name:'name3',age:23}
]; users.forEach(function(e){
console.log('name:'+e.name+',age:'+e.age);
}); </script>

运行结果:

name:name1,age:21
name:name2,age:22
name:name3,age:23

上一篇:水务新、老营收系统大PK


下一篇:NET Core + Ocelot + IdentityServer4 + Consul