js替换数据
<!DOCTYPE html>
<html lang="zh">
<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>
</body>
</html>
<script type="text/javascript">
var data = [
{
a:'1',
address:"阿斯顿"
},
{
a:'1',
address:"史蒂夫"
},
{
a:'1',
address:"史蒂夫"
},
{
a:'1',
address:"梵蒂冈"
},
{
a:'1',
address:"法国的"
},
{
a:'1',
address:"结婚可好"
}
]
var list = [1,2,3,4,5,6]
data.forEach((item,index)=>{
item.sss = list[index]
})
console.log(data)
</script>