title: ES6 filter - how to return an object instead of an array?
body: <p>I have bunch of array of object, I want to get particular object using filter, but I got array using below code. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const target = [{
    name: 'abc',
    id: 1
  }, {
    name: 'def',
    id: 2
  }]
  
  const x = target.filter(o =&gt; o.id === 1)
  console.log(x)</code></pre>
  </div>
  </div>
  </p>