Skip to content

Instantly share code, notes, and snippets.

View devphenom's full-sized avatar
🏠
Working from home

Ali Abdulsamad devphenom

🏠
Working from home
View GitHub Profile
const removeDuplicateInstances = (arrayList, val) => {
return Array.isArray(arrayList) === false
? "Your first argument must be an array"
: arrayList.length <= 0
? "Your array must contain at least one or more values"
: !val
? "You must pass in the second argument"
: arrayList.filter((index) => index != val).length;
};