**by using only dictionaries to remove duplicate elements in array.
Asked
Active
Viewed 466 times
-2
-
Please edit your question with the code you have tired, the input you have and the results desired so we may best assist you here. – Mark Schultheiss Feb 24 '22 at 23:09
1 Answers
0
let x = [1,2,3,1,2]
let arr2= {}
for(let i = 0; i <x.length;i++){
arr2 = Object.assign(arr2, {
[x[i]]: x[i]
})
}
console.log(Object.keys(arr2))

vantaku ramesh
- 29
- 4