JS之数组去重

2021-07-16 01:06

阅读:436

标签:indexof   数组   length   div   for   let   ==   new   people   

var arr = []
var peoples = [
    {id:1,name:‘wang‘},
    {id:2,name:‘zhang‘},
    {id:2,name:‘zhang‘},
]
for(let val of peoples){
    arr.push(val.id)
}
var newArr = [];
var newArr2 = [];
for(var i =0;i

  

JS之数组去重

标签:indexof   数组   length   div   for   let   ==   new   people   

原文地址:https://www.cnblogs.com/xuxml/p/9535285.html


评论


亲,登录后才可以留言!