title: Javascript object, return the updated object that contains a value in nested arrays
body: <p>I have the following object:</p>
  
  <pre><code>{
    "id": 2,
    "name": "tes name",
    "status": 0,
    "categories": [
      {
        "category_id": 1,
        "name": "taxes",
        "description": "taxes",
        "keys": [
          {
            "key_id": 1,
            "value": "preset unique value if not overridden, real text value"
          },
          {
            "key_id": 2,
            "value": "test name"
          }
        ]
      },
      {
        "category_id": 2,
        "name": "surcharges",
        "description": "surcharges",
        "keys": [
          {
            "key_id": 3,
            "value": "preset value if not overridden, real text value"
          },
          {
            "key_id": 5,
            "value": ""
          }
        ]
      },
      {
        "category_id": 3,
        "name": "errors",
        "description": "errors",
        "keys": [
          {
            "key_id": 6,
            "value": "preset value if not overridden, real text value"
          },
          {
            "key_id": 10,
            "value": "unique value to test search"
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>What I need to do is update the object based on: it must contain the key in the keys array if only key.value contains the string '<strong>unique</strong>' otherwise the array must not contain that key in the keys array.</p>
  
  <p>Expected output is:</p>
  
  <pre><code>{
    "id": 2,
    "name": "tes name",
    "status": 0,
    "categories": [
      {
        "category_id": 1,
        "name": "taxes",
        "description": "taxes",
        "keys": [
          {
            "key_id": 1,
            "value": "preset unique value if not overridden, real text value"
          }
        ]
      },
      {
        "category_id": 3,
        "name": "errors",
        "description": "errors",
        "keys": [
          {
            "key_id": 10,
            "value": "unique value to test search"
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>I tried nested filter but it won't work for me, always getting the same object as it is.</p>
  
  <p>my code:</p>
  
  <pre><code>var result = obj.categories.filter(function(category) {
      return category.keys.filter(function(key) {
          return key.value.includes(action.payload)
      });
  });
  </code></pre>
  
  <p>Any suggestions or where am I going wrong?</p>