Is there a reason why Array#clear method have not a exclamation mark (!)
at the end? Just like Array#map! because the object is altered (so it’s
called a dangerous method). In my opinion, Array#clear is an as
dangerous one that alters its object, and it may be used with the
exclamation mark…
What do you think about? Thanks for your comments.
Is there a reason why Array#clear method have not a exclamation mark (!)
at the end? Just like Array#map! because the object is altered (so it’s
called a dangerous method). In my opinion, Array#clear is an as
dangerous one that alters its object, and it may be used with the
exclamation mark…
What do you think about? Thanks for your comments.
The ! only has meaning when there’s also a non-! method of the same
name. There’s no general or abstract notion of danger – it’s always
comparative.