O'Reilly logo
  • Ronald Cosentino thinks this is interesting:

When it comes to deleting keys from hashes, you not only saw that you can do it with the delete method, but you also learned that delete both removes the key-value pair from the hash and returns the value, so you can save it in a variable if you want:


Cover of Ruby Wizardry


the delete method returns the value when it deletes rhe key.