title: How to check if value is in an array with objects based on another array
body: <p>In javascript I'm trying to check if value <em><strong>myPointID</strong></em> from <em><strong>b</strong></em> is in <em><strong>a</strong></em>.</p>
  <p>I've tried:</p>
  <pre><code>console.log(a.points.filter((f) =&gt; f.myPoint.myPointID === b.myPointID)); 
  </code></pre>
  <p>I can't seem to figure out the correct way.</p>
  <pre><code>var a = [
      {
          &quot;id&quot;: &quot;1&quot;,
          &quot;name&quot;: &quot;sample1&quot;,
          &quot;points&quot;: [
              {
                  &quot;pointID&quot;: &quot;12&quot;,
                  &quot;name&quot;: &quot;sample point&quot;,
                  &quot;myPoint&quot;: {
                      &quot;myPointID&quot;: &quot;12345&quot;,
                      &quot;name&quot;: &quot;sample my point&quot;,
                      &quot;form&quot;: &quot;form1&quot;
                  }
              }
          ]
      },
      {
          &quot;id&quot;: &quot;2&quot;,
          &quot;name&quot;: &quot;sample2&quot;,
          &quot;points&quot;: [
              {
                  &quot;pointID&quot;: &quot;123&quot;,
                  &quot;name&quot;: &quot;sample point2&quot;,
                  &quot;myPoint&quot;: {
                      &quot;myPointID&quot;: &quot;123456&quot;,
                      &quot;name&quot;: &quot;sample my point2&quot;,
                      &quot;form&quot;: &quot;form2&quot;
                  }
              }
          ]
      },
      {
          &quot;id&quot;: &quot;3&quot;,
          &quot;name&quot;: &quot;sample3&quot;,
          &quot;points&quot;: [
              {
                  &quot;pointID&quot;: &quot;123&quot;,
                  &quot;name&quot;: &quot;sample point2&quot;,
                  &quot;myPoint&quot;: {
                      &quot;myPointID&quot;: &quot;123456&quot;,
                      &quot;name&quot;: &quot;sample my point2&quot;,
                      &quot;form&quot;: &quot;form2&quot;
                  }
              }
          ]
      }
  ];
  
  var b = [
      {myPointID: &quot;123456&quot;, desc: &quot;sm&quot;},
      {myPointID: &quot;123456&quot;, desc: &quot;sm2&quot;}
  ];
  </code></pre>