title: Implement the removeProperty function that takes an object and a property name
body: <p>Implement the removeProperty function that takes an object and a property name and does the following:</p>
  
  <p>If object obj has property prop, it removes the property from the object.
  If the property has been removed, it returns true; otherwise it returns false.</p>
  
  <p>What is wrong with this code?</p>
  
  <pre><code>function removeProperty(obj,prop) {
  if(obj.hasOwnProperty('prop'))
    {
      console.log(obj);
      delete obj.prop;
      return true;
    }
    else
      {
        return false;
      }
  }
  
  var obj= {
    name:"John"
  };
  
  removeProperty({obj,'name'});
  </code></pre>