Why isn't "!" needed in title.to_sym?


#1

We do title.to_sym, not title.to_sym!. Why?


#2

Hey

The exclamation mark after methods are used as an indicator that the original object is being modified.
For instance, array.sort! will modify the orignal array, while array.sort will return a new array that has been sorted

Since .to_sym returns a symbol object, it doesn't modify the orignal one, and because of that there's no ! after the method name


#3

Got it! Thank you! @distrattos