get the duplicates in the array, const arr = [1,2,3,4,1,2,10]
Anonymous
let duplicates = (arr) =>{ let obj = {} arr.forEach((e) => { if(obj.hasOwnProperty(e)) { console.log(e) } else obj[e] = 1; }) console.log(obj) }
Check out your Company Bowl for anonymous work chats.