Skip to content

Commit e77deff

Browse files
committed
complete callbacks stretch 'remove duplicates'
1 parent d827099 commit e77deff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

assignments/callbacks.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,12 @@ function removeDuplicates(array, cb) {
8080
// removeDuplicates removes all duplicate values from the given array.
8181
// Pass the duplicate free array to the callback function.
8282
// Do not mutate the original array.
83+
let duplicateFreeArray = [...new Set(array)];
84+
return cb(duplicateFreeArray);
8385
}
86+
87+
removeDuplicates([1,2,3,4,3], newArray => {
88+
console.log(newArray);
89+
});
90+
91+

0 commit comments

Comments
 (0)