for example i have an array

int[] a = [1,2,3,4,5];

and a function

auto twice  = function (int x) => x * 2;

how can i apply the function to each element in a without using a forloop? - is there a function to do this?

a.foreach(x => x * 2);
a == [2,4,6,8,10]

Reply via email to