title: How to update value of nested array of objects
body: <p>This is my actual array :</p>
  
  <pre><code>let mainArray= [
      {
          value: '/AG_TURF-123',
          label: 'Ag &amp; Turf',
          checked: false,
          id:123,
          children: [
              {
                  value: '/AG_TURF-123/TRACTOR-456',
                  label: 'Tractors',
                  checked: false,
                  id:456,
                  children: [
                      {
                          value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series',
                          label: 'Large (7, 8, 9) Series',
                          checked: false,
                          id:789,
                          children: [{
                              value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series/7-family-tractor',
                              label: '7 Family Tractor',
                              checked: false,
                              id:101112
                          },{
                              value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series/8-family-tractor',
                              label: '8 Family Tractor',
                              checked: false,
                              id:131415
                          },{
                              value: '/AG_TURF-123/TRACTOR-456/Large-7-8-9-series/9-family-tractor',
                              label: '9 Family Tractor',
                              checked: false,
                              id:161718
                          }],
                      },
                      {
                          value: '/app/Http/routes.js',
                          label: 'routes.js',
                          checked: false,
                          id:181920
                      },
                  ],
              },
              {
                  value: '/app/Providers',
                  label: 'Providers',
                  checked: false,
                  id:212223,
                  children: [{
                      value: '/app/Http/Providers/EventServiceProvider.js',
                      label: 'EventServiceProvider.js',
                      checked: false,
                      id:242526
                  }],
              },
          ],
      },
      {
          value: '/config',
          label: 'config',
          checked: false,
          id:272829,
          children: [
              {
                  value: '/config/app.js',
                  label: 'app.js',
                  checked: false,
                  id:303132
              },
              {
                  value: '/config/database.js',
                  label: 'database.js',
                  checked: false,
                  id:333435
              },
          ],
      },
      {
          value: '/public',
          label: 'public',
          checked: false,
          id:353637,
          children: [
              {
                  value: '/public/assets/',
                  label: 'assets',
                  checked: false,
                  id:383940,
                  children: [{
                      value: '/public/assets/style.css',
                      label: 'style.css',checked: false,
                      id:404142
                  }],
              },
              {
                  value: '/public/index.html',
                  label: 'index.html',
                  checked: false,
                  id: 434445
              },
          ],
      },
      {
          value: '/.env',
          label: '.env',
          checked: false,
          id: 464748
      },
      {
          value: '/.gitignore',
          label: '.gitignore',
          checked: false,
          id: 495051
      },
      {
          value: '/README.md',
          label: 'README.md',
          checked: false,
          id: 525354
      },
  ];
  </code></pre>
  
  <p>This is my list of value :</p>
  
  <p><code>const ids=[525354,123,131415];</code></p>
  
  <p>I want to set <code>checked</code> to <code>true</code> if id matched.
  My main array may go to 6 to 7 step deep.</p>
  
  <p>What I've done till yet :</p>
  
  <pre><code>setCheckedFlagToItems(checkList, items) {
          return items.map((item) =&gt; {
              const node = item;
              if (checkList.indexOf(node.id) !== -1) {
                  node.checked = true;
              }
              if ((node.children) &amp;&amp; (Array.isArray(node.children) &amp;&amp; node.children.length &gt; 0)) {
                  this.setCheckedFlagToItems(checkList, node.children);
              }
              return node;
          }, this);
      }
  </code></pre>
  
  <p>But it not working as usual. </p>