title: Reduce object thought object.entries
body: <p>I have this kind of object</p>
  <p>I want to get new object with keys that have &quot;exist === true&quot;</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 someObj  = {
        super: {
          exist: true
        },
        photo: {
          exist: true
        },
        request: {
          exist: false
        }
  }
  const newObj = Object.entries(someObj).reduce((newObj, [key, val]) =&gt; {
    if (this.key.exist) { // how to check "exist" is true ?
      return { ...newObj, [key]: val }
    }
  }, {});
  
  console.log(newObj);</code></pre>
  </div>
  </div>
  </p>