title: search inside child Array of objects - JavaScript
body: <p>Currently i have below Array of Objects</p>
  
  <pre><code>obj = [
      {
          "id":28,
          cities: [
              {
                  cityTypes: "AA",
                  citySource: "sdsf"
              },
              {
                  cityTypes: "BB",
                  citySource: "sdsgf"
              },
              {
                  cityTypes: "CC",
                  citySource: "fgsdfgd"
              }
          ]
      }, 
      {
          "id":56,
          cities: [
              {
                  cityTypes: "DD",
                  citySource: "sdsf"
              },
              {
                  cityTypes: "EE",
                  citySource: "sdsgf"
              },
              {
                  cityTypes: "FF",
                  citySource: "fgsdfgd"
              }
          ]
      }, 
      {
          "id":89,
          cities: [
              {
                  cityTypes: "GG",
                  citySource: "sdsf"
              },
              {
                  cityTypes: "HH",
                  citySource: "sdsgf"
              },
              {
                  cityTypes: "II",
                  citySource: "fgsdfgd"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>I need to search <code>cityTypes</code> of specific value is present in the whole <code>Object</code>.</p>
  
  <p>For suppose, i need to search <code>cityTypes = BB</code></p>
  
  <p>If <code>BB</code> is present in the whole object, return true</p>
  
  <p>If <code>BB</code> is not preset, return <code>false</code>.</p>
  
  <p>This is what i have tried, which does not seem to work.</p>
  
  <pre><code>for(let k=0; k&lt;obj.length; k++){
      if(obj[k].cities){
          let cityObj = obj[k].cities;
          for(let city in cityObj){
              city.cityTypes !== "BB" ? "true" : "false"
          }
      }
  }
  </code></pre>
  
  <p>What is the proper way to achieive this?</p>