Although my JavaScript skills are not advanced, I recommend checking out the following URLs for some guidance:
How to loop through a plain JavaScript object with the objects as members?
These resources may provide you with some ideas on how to approach your problem.
How can I slice an object in Javascript?
If you still haven't found a solution, try implementing a function that iterates over objects based on my suggestion.
Start by creating a variable =1 and follow the logic provided:
If var_inc==1 or var == 2, continue; else, proceed with your tasks.
Next, use a for loop to iterate over objects and apply the previously defined function.
By understanding the logic behind this process, you may find your solution.
❤🌷😅