title: Filter value of object in VueJS
body: <p>I need to check if the <strong>value</strong> of <strong>startAt</strong> is present in an object. It should return the <strong>id</strong> of that object if it's in it.</p>
  
  <p>Object:</p>
  
  <pre class="lang-js prettyprint-override"><code>[{
    "id": "1234567",
    "createTimestamp": "2020",
    "name": {
      "action": "",
      "allDay": false,
      "category": "Misc",
      "startAt": "05",
      "title": "foo"
    },
    "updateTimestamp": "2020"
  }]
  </code></pre>
  
  <p>Below is what I have so far. The filtering works but I can't access the <strong>id</strong> to return it.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div v-for="(hour, i) in 24" :key="i"&gt;
    {{ filterByHour(hour) }}
  &lt;/div&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>filterByHour(id) {
    if (id &lt; 10) {
      id = 0 + id
    }
  
    const result = this.events.filter(item =&gt; item.name.startAt === id.toString())
    return result
  }
  </code></pre>
  
  <p>How to return the <strong>id</strong> of the object?</p>