5 kyu
Argument Mapper
601ohager
Description:
As part of a broader functionality you need to develop an argument mapper.
The function receives a function object as first parameter and an unknown number of arguments [zero to many]. You have to return an associative array that maps the name of an argument and its related value.
The usage is:
function func1(arg1, arg2) { }
var map = createArgumentMap(func1,'valueOfArg1', 'valueOfArg2');
console.log(map['arg1']); // writes 'valueOfArg1'
console.log(map['arg2']); // writes 'valueOfArg2'
The passed values are in the same order as they appear in the function object.
Invalid inputs, e.g. non-function objects, or wrong number of arguments, are not considered.
Hajime!
Reflection
Fundamentals
Similar Kata:
Stats:
Created | Feb 15, 2014 |
Published | Feb 15, 2014 |
Warriors Trained | 1516 |
Total Skips | 397 |
Total Code Submissions | 3360 |
Total Times Completed | 601 |
JavaScript Completions | 601 |
Total Stars | 24 |
% of votes with a positive feedback rating | 83% of 101 |
Total "Very Satisfied" Votes | 73 |
Total "Somewhat Satisfied" Votes | 21 |
Total "Not Satisfied" Votes | 7 |