JSFiddle - React, Tailwind, and code Playground
JavaScript
/*
write a function that given an array of values can return the number of times any of its values are repeated. For example if the input is [1, 2, 2, 2] then your program should output 3 because the number 2 appears three times.
*/
var arr = [1,2,2,2,3,3,3];
var repeater = function(arr){
for (var i = 0; i<arr.length; i++){
console.log(i);
var occurences = arr.filter(i)
}
}