Advertisement
Pijomir

Distinct Array

Aug 19th, 2022
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function distinctArray(arr) {
  2.     let result = arr.filter((el, i) => {
  3.         return arr.indexOf(el) === i
  4.     });
  5.  
  6.     console.log(result.join(' '));
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement