title: Remove all other properties from object leave only selected
body: <p>I need to remove all array members that are not based on property given, here is example I have something like this</p>
  <pre><code>    const idToStay = 1;
  
      const objList = [{
          id: 1,
          name: 'aaa',
        },
        {
          id: 4,
          name: 'bbb',
        },
        {
          id: 7,
          name: 'ccc',
        },
      ];
  </code></pre>
  <p>I need to remove all others objects that does not have id with number 1, I know how to remove but how to stay and remove all others</p>
  <p>Here I can remove like this</p>
  <pre><code>const filteredObjList = objList.filter(x =&gt; !idsToRemove.includes(x.id));
  
  console.log(filteredObjList);
  </code></pre>