JS ⟩ value ⟩ object⟩ built-in ⟩ Array ⟩ extension ⟩ arr.removeDuplicates()
replit
Object.defineProperties(Array.prototype, { // 🔹 .removeDuplicates() removeDuplicates: { value: function() { return [... new Set(this)]; // new array (non-mutating) }, }, });
[ 1, 1, 2, 3, 2, 3, 4 ].randomElement, // (random) [ 1, 1, 2, 3, 2, 3, 4 ].removeDuplicates(), // [ 1, 2, 3, 4 ] [1].concat([1,2,3],[2,3,4]), // [ 1, 1, 2, 3, 2, 3, 4 ] [1].union([1,2,3],[2,3,4]), // [ 1, 2, 3, 4 ]
各班平均及前三名
arr.uniqueMerge()
keyword - list all keywords.
contextual keyword - list all contextual keywords.
Set
Last updated 1 year ago