Tell us what’s happening:
I dont why it can
t be passed.
const getMode = (array) => {
const counts = {};
array.forEach(el => counts[el] ? counts[el]+=1 : counts[el]=1);
return counts;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
Challenge Information:
Learn Advanced Array Methods by Building a Statistics Calculator - Step 35