I have code like this
list << num if num.to_s.split("").map(&:to_i).map(&:factorial).inject(:+) == num
It works, and I was wondering how inject
works without the &
(ampersand) in front of the :+
. I am asking for someone to explain what the differences are between :+
and &:+
.