@ankur1163 Large scale apps are built by multiple people in sprints - architecture design comes usually first there. Its pretty much an iterative process though where they start with an MVP (Minimum Viable Product) and build new features after each other.The API and the Frontend are usually created in parallel. As long as the Frontend people don't have the data of the server ready yet, they rely on fake data. There has to be an upfront API specification though so that they know what data will come from where so they can fake it properly.

If you're doing things alone, I'd do the api first and then the frontend as you say, but also iteratively - Integrate the api part which is needed for the first few features, then make the frontend for it. Then go to the server again to build up the base for more features.

@bradley1492 result is the object you are creating, current is the key you are accessing, if it already exists you add one, otherwise you initialize it to 1. Then you return the object for the next element in the array

so.... result starts as an empty object (see the {} just before the closing parenthesis), and then for each element you either increase the count or add a new key with value 1 to it.

Okay, thanks for this explanation. I think in order to clearly understand this, I have to get to grips with reduce a bit more. Specially connecting with objects.In my world reduce was only array based...I didn't obviously know reduce could output objects if you input arrays.But still this is quite helpful as it gives me sort of a list, on what things I have to understand next :)

Ahh one can create objects as starting points, this makes it a lot clearer

That are usual concerns. And you indeed could always have done something better. That won't ever go away ^^ You can only try your best and that will have to be good enough :-) Don't let yourself down from the many choices you have. Take some choices which seem valid for you and stick to them. Don't go change a whole architecture midways for a little to medium concern. That only costs time.

After all, you will be learning from every step you take

And you will know better every next time you have to make a decision :-)

@sjames1958gm Thanks again! Your suggestion on removing eventListeners was a really big help. Actually, I read a lot about adding them but never thought it would be necessary to remove them. Here is the code working as expected. Finally!https://codepen.io/MaciejReimann/pen/xpLvRz