title: How do i access a property on the objects in an array and compare it?
body: <p>So, I have a array with multiple objects with multiple properties:</p>
  <pre><code>let myArr = [{
  id: 1,
  x: 120,
  y: 150,
  }, {
  id: 2,
  x: 170,
  y: 420,
  }, {
  id: 3,
  x: 160,
  y: 220,
  }, {
  id: 4,
  x: 140,
  y: 170,
  }];
  </code></pre>
  <p>Now I want to see if the property of one of the objects in my array matches a variable.
  But I dont know how to do that!
  I want to check if the value of property &quot;id&quot; in one of my objects matches my variable.
  Something like this:</p>
  <pre><code>if(myArr[0].id == myVar){
  //do something
  }
  </code></pre>
  <p>but this for each object in my array</p>