I have the following JavaScript object.
let obj = {
  "type": "user",
  "personalDetails": {
    "firstName": "Steven",
    "address": {
      "streetName": "abcd",
      "zipCode": "012345"
    }
  },
  "employeeDetails": {
    "designation": {
      "id": "1234",
      "manage": "Mark",
    }
  }
}
How can I create a dynamic function which will take this
JS object objas a first argument, one parent node as the second argument and a child node as the third argument.if the third argument is present as a child node inside the second argument, the function should return true. For example.
const childNodeExist = (obj, personalDetails, firstName) => {
    //.. since firstName exists in personalDetails should return true
}
const childNodeExist = (obj, employeeDetails, designation) => {
    //.. since designation exists in employeeDetails should return true
}
const childNodeExist = (obj, employeeDetails, salary) => {
    //.. since salary exists in employeeDetails should return false
}
 
     
     
    