Answers for "if the object obj has a property prop, the function removes the property from the object and returns true; in all other cases it returns false."

0

implement the remove property function

function removeProperty(obj, prop) {
  
  if (obj.hasOwnProperty(prop)) { 
    delete obj[prop];
    return true;
  }

  return false;
}
Posted by: Guest on September-30-2020

Code answers related to "if the object obj has a property prop, the function removes the property from the object and returns true; in all other cases it returns false."

Code answers related to "Javascript"

Browse Popular Code Answers by Language