Data source: http://rosettacode.org/wiki/Apply_a_callback_to_an_array