Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
^ is not a valid character Ruby for method name. But ! and ? is valid characters for method name. Why?
In one of the quizzes said as follows.
^ is not a valid character Ruby for method name. But ! and ? is valid characters for method name.
Ari Misha19,323 Points
Hiya there! As a Ruby developer for years now, i think Ruby is the most versatile and flexible language i know. And every symbol has some kinda meaning and best practices to it. Like you may come across seeing the methods ending with ! and ?. There are methods who does stuff to array or original values but dont mutate the original values. So ! represents the methods where original values do get mutated. Whereas ? at the end of some method represents that the same method throws a boolean value. There are many more characters but ^ is an invalid character.