title: Select a property from an array of objects based on a value : Javascript
body: <p>I have an array of objects with the following structure:</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>var arr = [
    {
      "value": "abc",
      "checked": true
    },
    {
      "value": "xyz",
      "checked": false
    },
    {
      "value": "lmn",
      "checked": true
    }
  ];
  
  let result = arr.filter(item =&gt; item.checked);
  
  console.log(result);</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would want the output to be: </p>
  
  <pre><code>["abc", "lmn"] 
  </code></pre>
  
  <p>Because those two <code>value</code>s have <code>checked: true</code>.</p>
  
  <p>I have tried filtering out based on checked value:</p>
  
  <pre><code>let result = arr.filter(item =&gt; item.checked);
  </code></pre>
  
  <p>I am getting the objects that has <code>checked</code> property value that is set to <code>true</code>.</p>
  
  <p>Help would be appreciated.</p>