7 kyu
Easy mathematical callback
859 of 7,381nghier
Description:
Task
Write the processArray function, which takes an array and a callback function as parameters. The callback function can be, for example, a mathematical function that will be applied on each element of this array. Optionally, also write tests similar to the examples below.
Examples
Array
[4, 8, 2, 7, 5]
after processing with functionfunction(a): return a*2;
will be
[ 8, 16, 4, 14, 10 ]
.Array
[7, 8, 9, 1, 2]
after processing with functionfunction(a): return a+5;
will be
[ 12, 13, 14, 6, 7 ]
.
Algorithms
Similar Kata:
Stats:
Created | Jan 15, 2015 |
Published | Jan 15, 2015 |
Warriors Trained | 10351 |
Total Skips | 354 |
Total Code Submissions | 23745 |
Total Times Completed | 7381 |
JavaScript Completions | 6499 |
Python Completions | 859 |
C# Completions | 126 |
Total Stars | 55 |
% of votes with a positive feedback rating | 84% of 584 |
Total "Very Satisfied" Votes | 450 |
Total "Somewhat Satisfied" Votes | 83 |
Total "Not Satisfied" Votes | 51 |