7 kyu
Currying functions: multiply all elements in an array
12,546 of 16,013limeyb7
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 | 24252 |
Total Skips | 867 |
Total Code Submissions | 35706 |
Total Times Completed | 16013 |
JavaScript Completions | 12546 |
PHP Completions | 329 |
C# Completions | 309 |
Elixir Completions | 158 |
Python Completions | 2361 |
Scala Completions | 142 |
Java Completions | 380 |
OCaml Completions | 33 |
Total Stars | 203 |
% of votes with a positive feedback rating | 93% of 1512 |
Total "Very Satisfied" Votes | 1332 |
Total "Somewhat Satisfied" Votes | 145 |
Total "Not Satisfied" Votes | 35 |
Total Rank Assessments | 12 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |