deduplicate array js code example
Example 1: js array clone
let clone = [...myArray]
Example 2: javascript duplicate an array
let arr =["a","b","c"];
// ES6 way
const duplicate = [...arr];
// older method
const duplicate = Array.from(arr);
Example 3: remove duplicates from array javascript
arr.filter((v,i,a)=>a.findIndex(t=>(t.place === v.place && t.name===v.name))===i)
Example 4: deduplicate array javascript
function uniq(a) {
return Array.from(new Set(a));
}