Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const arr = [2, 1, 3, 4, 6, 0, 0, 5, 7, 8, 10];
- let uniqueArr = arr.filter(function (item, index, arr) {
- if (item != arr[index + 1]) {
- return item;
- }
- })
- console.log(uniqueArr)
Advertisement
Add Comment
Please, Sign In to add comment