Remove Duplicates array

PHOTO EMBED

Sun Jul 17 2022 07:07:43 GMT+0000 (Coordinated Universal Time)

Saved by @man_ssorr #javascript

const array  = [5,4,7,8,9,2,7,5];
array.filter((item,idx,arr) => arr.indexOf(item) === idx);
// or
const nonUnique = [...new Set(array)];
// Output: [5, 4, 7, 8, 9, 2]
content_copyCOPY

https://dev.to/devsimc/javascript-best-practices-44ll