I could really use some help Debugging a problem. Im trying to build a nested object (tree) from a very unusual array im getting from a backend (dont have access to the BE so i have to work with what i got). I’ve gotten 95 percent of it done but im running into a bug I know there are many
Tag: nested-object
transfer flat object to nested object (javascript)
i am getting a flat object of cms navigation and want to transfer it to a nested object. The level describes the position of the element in the tree. Whenever there are subelements they should be stored under a new subCategory. In every level could be multiple elements. For example two level 1 categories (“shop service” and “information”). The flat
Checking for duplicate property values in an array of nested objects
I have a JSON file with an array that has nested objects and arrays that simulates a shopping cart. I want to check for duplicate values and if there are any, update the quantity value of the item otherwise, just add the items to the cart. Here is the JSON file: And here is what I have done so far: