Accumulate

in #ita25 days ago

declare(strict_types=1);

function accumulate(array $input, callable $accumulator): array{

$result = [];

for($i=0; $i<count($input); $i++) {

   $result[$i] = $accumulator($input[$i]); 

}

return $result;

}

Sort:  

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below


Hey @drago18121996, here is a little bit of BEER from @isnochys for you. Enjoy it!

Learn how to earn FREE BEER each day by staking your BEER.