💾arr.removeDuplicates()
JS ⟩ value ⟩ object⟩ built-in ⟩ Array ⟩ extension ⟩ arr.removeDuplicates()
Object.defineProperties(Array.prototype, {
// 🔹 .removeDuplicates()
removeDuplicates: {
value: function() {
return [... new Set(this)]; // new array (non-mutating)
},
},
});
Last updated
Was this helpful?