myFunc = function(x) return x*x end print(unpack( map(myFunc, myArray) )) --> 1 4 9 16 25