README.md doesn't adequately convey whether Array.prototype.unique() modifies the array or whether it returns a new array.
no parameter, it'll work as [...new Set(array)];
Seems to create a new array since it implies data.unique() instead of data = data.unique().
one index-key parameter (Number, String or Symbol), it'll get values from each array element with the key, and then deduplicates the origin array based on these values;
The "deduplicates the origin array" implies mutating the original array.
For case 3, the above applies.
Typical cases section doesn't give any hints either. It would help if there was a simple data-row with returned value in comment indicating whether it was either modified or not.
Finally, the TypeScript polyfill looks like it doesn't modify the original array.
README.md
doesn't adequately convey whetherArray.prototype.unique()
modifies the array or whether it returns a new array.For case 3, the above applies.
Typical cases section doesn't give any hints either. It would help if there was a simple
data
-row with returned value in comment indicating whether it was either modified or not.Finally, the TypeScript polyfill looks like it doesn't modify the original array.