Javascript – Get all the objects from an array that is direct/nested children of another object
So I have a javascript array that looks like this (simplified). Here beauty (id:1) and health (id:2) is root categories as they have a null value of parentCategoryId. hair care (id:3), hair oil (id:4) and kumarika hair oil (id:5) falls…