I’m learning Ruby and I’ve seen that an exclamation mark at the end of a method name by convention means that the method modifies self in some way. Why doesn’t then Array#delete end with an exclamation mark, like slice! does, since delete deletes an element from self? Am I missing something fundamental?
I’m learning Ruby and I’ve seen that an exclamation mark at the end of
Share
To quote Matz (Ruby’s chief engineer):
Since
Array#deletedoesn’t have a less-dangerous counterpart, there is no need for the exclamation.