check childId match with parentId or not in js – Javascript
Here I have created a function that will compile whether an object's parentid matches its childId or not, so id 1 is a parent Id that has a child with 11,12, so if I call that function checkParentId(obj, 1, 12),…