Question from the Ruby test

Call a method only if the caller is not null.,Does the same thing as `@my_object.try!(:my_method)`.

Hard

what is the purpose of adding the & in result = @my_object&.my_method ?

Author: HivebriteStatus: PublishedQuestion passed 253 times
Edit
0
Community Evaluations
developer avatar
To
21/02/2024
les accents dans la ligne de code ?
developer avatar
Auteur anonyme
21/02/2024
Oui, c'est fascinant mais le code Ruby peut-ĂȘtre en utf-8