What is the use of Destructive Method in ruby?

In ruby programming Destructive methods are used to change the object value permanently by itself using bang (!) operator. The exclamation point (!, sometimes pronounced aloud as “bang!”)

When we attach exclamation point or question mark (‘!’ or ‘?’) to the end of certain method names. It  indicates something potentially destructive, means something that can change the value of what it touches.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.