This is the function for getHighestDuplicates, where the course asks you to find the highest number of duplicates in the array of random dice values and output the sums of everything if there are 3 or 4 of a kind, and 0 if not.
This is what I came up with, it didn’t pass, & i need to catch up with some completion timeline thing im putting on myself so I didnt want to fully investigate this, but it looks right to me and I think I got one aspect of it wrong maybe. And I also know the compiler can be finicky about nomenclature sometimes. (This is my solution compared to the one that is prepared if you skip ahead, which is structured much differently with multiple iteration structures). Idk it looks right to me:
const getHighestDuplicates = (array) => {
const counts = ;
for (let i =0; i<array.length; i++){
const count = array.filter(i === array[i]);
counts.push(count.length);
}
if(counts.includes(4)){
updateRadioFunction(1, array.reduce((a,b) => {a+=b}, 0));
} else if(counts.includes(3)){
updateRadioFunction(0, array.reduce((a,b) => {a+=b}, 0));
} else {
updateRadioFunction(5, 0);
}};