title: Why are the keys not being deleted from my object?
body: <p>Here is some sample code that is part of an API I am building. The endgame for this part is to simply whittle down objects based on a set of keys passed in via a string array.</p>
  
  <pre><code>/**
   * @param {object} vdObj - an array of the raw vendor data
   * @param {Array} keptKeys - an array or strings representing the key names we wish to keep.
   * @returns {object} A 'filtered' object
   */
  const objFilter = function objFilter(vdObj, keptKeys) {
    const returnedObjKeys = Object.keys(vdObj);
    const returnedObj = vdObj;
  
    returnedObjKeys.forEach(key =&gt; {
      if (!keptKeys.includes(key)) {
        // If this is not a key that we want to keep...(https://www.w3schools.com/jsref/jsref_includes_array.asp)
        console.log(key);
        delete returnedObj.key;
      }
    });
  
    console.log(`returnedObj: ${JSON.stringify(returnedObj)}`);
    return returnedObj;
  };
  
  const someObj = {
    fname: "Fatty",
    lname: "McGee",
    age: "29",
    gender: "M"
  }
  
  const keptKeys = ["fname", "lname"];
  
  objFilter(someObj, keptKeys);
  </code></pre>
  
  <p>As per: <a href="https://jsfiddle.net/visweb/L8xfcdat/1/" rel="nofollow noreferrer">https://jsfiddle.net/visweb/L8xfcdat/1/</a> <code>returnedObj</code> does not seem to have its keys deleted.</p>