A couple of neat methods I learned this week were
reduce. These incredibly simple and efficient methods surprised me. swapcase takes a string and “swaps” the cases of each letter. i.e :
"I am a String".swapcase => "i AM A sTRING
In this case each element of the array is passed to the add method and thus it adds each element to the accumulator.