Learn Advanced Array Methods by Building a Statistics Calculator - Step 30

Tell us what’s happening:

Step 30
To calculate the occurrence you can use the following approach:

Example Code
const numbersArr = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4];
const counts = {};
numbersArr.forEach((el) => {
if (counts[el]) {
counts[el] += 1;
} else {
counts[el] = 1;
}
});
Check if the current number is already in the counts object. If it is, increment it by 1. If it is not, set it to 1.

Resulting object. The keys are the numbers from the array and the values are the number of times each num

this step’s instructions are barely comprehensible . “calculate the occurrence” without specifying what one is supposed to be calculating the occurrence of is not idiomatic English. I understand we’re talking about the mode, but as far as I know, no one uses the phrase “calculate the occurrence”, with no object, to describe that.

and what is “Resulting object .” supposed to mean? that’s obviously not a grammatical sentence, and nothing about the context makes it any more sensical.

I hate being a stickler about “correct” language. this is just gibberish, though.

For this step, start by declaring an empty counts object.

In this step it just wants you to create a new empty object with a name counts, nothing more. Like: let newObj = {}

Hope this helps

Thank you, but I don’t need help completing the step. I’ve completed it. I’m saying the instructions are barely comprehensible.

Welcome to the forum @rspadine

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

Happy coding

It isn’t a bug. the instructions just make no sense.

The wording for a step can be raised as an issue on Github.

You don’t need to provide an alternative, just specify what parts don’t make sense.