refactoring (#4)
This commit is contained in:
7
functions/CountOccurences.js
Normal file
7
functions/CountOccurences.js
Normal file
@ -0,0 +1,7 @@
|
||||
const CountOccurences = (arr, value) => {
|
||||
return arr.filter((v) => (v === value)).length;
|
||||
};
|
||||
|
||||
module.exports = { CountOccurences };
|
||||
|
||||
//console.log(countOccurrences([1,2,3,4,3,2,3,3,2],2));
|
Reference in New Issue
Block a user