Wanted to know how can we access infinitely nested object in JS? 

Consider this example given to be my interviewer

You have an object with a Parent and infinitely nested children

```
[ 
 { 
   name: "Jack",
   age: "98" ,
   profession: "doctor
   children: [
               {
                 name: "Varun",
                 age: "80"
                 profession: "scientist"
                 children: [
                             {
                                name: "Ishan"
                                age: "62",
                                profession: "teacher
                                children: [{....
                                 .....
                                 .....[{
                                       name: "Rahul",
                                       age: "23",
                                       profession: "engineer"
                                      children: [{
                                                  .....

```

I need to find the name corresponding where profession is "engineer" and how deep that given object is nested. 

Note: Number of children to be considered here is infinite. 

Question: Can someone help me in figuring out how I can do it **with recursion** and **without recursion**

**update:** He gave me a hint to use divide and conquer 

**Update:** Based on the solution by Bary, I tried something like this 

```
let infiniteArray = [ 
    { 
      name: "Jack",
      age: "98" ,
      profession: "doctor",
      children: [
                  {
                    name: "Varun",
                    age: "80",
                    profession: "scientist",
                    children: [
                                {
                                   name: "Ishan",
                                   age: "62",
                                   profession: "teacher"
                                }
                            ]
                    }
                ]
        }
]

function isTheItem(item) {
   if (item["profession"] === "teacher") return item
    return false
 }

 function walk(collection) {
    return collection.find(item => isTheItem(item) || walk(item.children));
  }

```

But when I console.log it, i.e `console.log(walk(infiniteArray))`, it is logging the entire infiniteArray and I understand why but I went it to return just the name corresponding to profession. Any help on how I can achieve it?

```
  name: "Ishan",
        age: "62",
        profession: "teacher"
    }

```