7 kyu
Currying functions: multiply all elements in an array
12,640 of 16,171limeyb7
Description:
To complete this Kata you need to make a function multiplyAll
/multiply_all
which takes an array of integers as an argument. This function must return another function, which takes a single integer as an argument and returns a new array.
The returned array should consist of each of the elements from the first array multiplied by the integer.
Example:
multiplyAll([1, 2, 3])(2) = [2, 4, 6];
You must not mutate the original array.
Here's a nice Youtube video about currying, which might help you if this is new to you.
Functional Programming
Fundamentals
Similar Kata:
Stats:
Created | Jan 1, 2017 |
Published | Jan 1, 2017 |
Warriors Trained | 24480 |
Total Skips | 881 |
Total Code Submissions | 36009 |
Total Times Completed | 16171 |
JavaScript Completions | 12640 |
PHP Completions | 334 |
C# Completions | 315 |
Elixir Completions | 159 |
Python Completions | 2411 |
Scala Completions | 144 |
Java Completions | 387 |
OCaml Completions | 33 |
Total Stars | 204 |
% of votes with a positive feedback rating | 93% of 1525 |
Total "Very Satisfied" Votes | 1341 |
Total "Somewhat Satisfied" Votes | 147 |
Total "Not Satisfied" Votes | 37 |
Total Rank Assessments | 12 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |