I’m trying to understand the .reduce() function and the best way to go about the following. I’ve got the following code: I want to add a product with no ‘category’ property in it, and I want it pushed into a specific key rather than getting grouped in “undefined”, so I edited it to: For the most part it works (there’s
Tag: simplify
How to simplify object
I have an issue here where the code is quite heavy and quite hard to read imo. I’ve simplified the code as much as I can but I was wandering if there’s a way to simplify this code even further? Or maybe if there is any better terminology i could use for the comments? Any help is much appreciated, Thanks