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 257 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!