<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Document</title></head><body><div id="container"></div><script> (function(){ var data = [{num:20,age:30},{num:30},{num:40},{num:50}]; var container = document.getElementById('container'); function render(data){ container.innerHTML = data.map(function(item){ var i ; console.log(item) for(i in item){ console.log(i) if(item.hasOwnProperty(i)){ // console.log(i); return item[i]; } } }); } render(data); })() </script></body></html>
添加回答
举报
0/150
提交
取消