I’m trying to work through the software engineering foundations course before my cohort start date on August 31. I was comparing my solutions to the answers for “nauseating numbers” under W1D3 when I noticed the answer for mutual_factors used Array.inject(:&) and I was hoping to get an explanation of how this worked. I have a basic understanding of inject from the notes/lecture on W1D1 for this course, but this seems to be a new use of inject that wasn’t covered.
I get that in this case inject is being passed the symbol “:&” but I’m not sure what this symbol represents and I don’t really comprehend how inject works when it’s only passed a symbol. The documentation for inject in this case references a method called memo, but that seems to be linked to the underlying C++ and I don’t really follow.
Any explanation around how inject works in this case and what the :& symbol does would be much appreciated. Also, is there some resource available that lists and defines all the symbols native to ruby?
Thanks in advance!