Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function distinctArray(arr) {
- for (let i = 0; i < arr.length; i++){
- for (let j = i + 1; j < arr.length; j++){
- if (arr[i] === arr[j]){
- arr.splice(j, 1);
- j--;
- }
- }
- }
- console.log(arr.join(' '));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement