Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

WM5 | Sariat Adenike | Module-JS2 | Week-1 #77

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Created the function and used .includes
  • Loading branch information
sariat0001 committed Nov 10, 2023
commit 7cdb9ceb51f2d03e201e9dc9969a56c8bd8380dd
10 changes: 9 additions & 1 deletion week-1/implement/dedupe.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
function dedupe() {}
function dedupe(arr) {
let newArr = [];
for (const item of arr){
if (!newArr.includes(item)) {
newArr.push(item);
}
}
return newArr;
}