title: JavaScript error: Cannot read property 'includes' of undefined
body: <p>I want to check if a <code>data.objectId</code> already exists in the array <code>msgArr</code>. For that I am running the code below:</p>
  
  <pre><code>var exists = msgArr.objectId.includes(data.objectId);
  
  if(exists === false){
     msgArr.push({"objectId":data.objectId,"latLont":data.latLont,"isOnline":data.isOnline});
  }
  </code></pre>
  
  <p>The array looks like the following:</p>
  
  <pre><code>var msgArr = [
    {isOnline:true,latLont:"123",objectId:"on0V04v0Y9"},
    {isOnline:true,latLont:"1",objectId:"FpWBmpo0RY"},
    {isOnline:true,latLont:"48343",objectId:"Qt6CRXQuqE"} 
   ]
  </code></pre>
  
  <p>I am getting the error below:</p>
  
  <blockquote>
    <p>Cannot read property 'includes' of undefined</p>
  </blockquote>