Serialize Function Arguments
Description:
Serializing data in Javascript is a common practice, usually that is done to form values before sending them through a request. But consider this scenario.
Given a function with arguments, we would like to serialize its values and parameters into a string of key/value pairs, while optionally ommiting some keys(parameters).
Example usage:
function someFunction (name, family, position, n_children) {
data = serializeFunc(someFunction, arguments, ['family', 'n_children']);
// data's value would be: name=joe&position=developer
// rest of the function...
}
Implement the serialize function so that it serializes the function's arguments into a string of parameter/argument pairs. Keys being the parameter names and values being the respective argument values.
The function should take three parameters: function, arguments, and optional list of excluded keys.
To make it simple, lets consider that all the values being passed are either string or number.
Similar Kata:
Stats:
Created | Feb 2, 2014 |
Published | Feb 2, 2014 |
Warriors Trained | 826 |
Total Skips | 319 |
Total Code Submissions | 839 |
Total Times Completed | 98 |
JavaScript Completions | 97 |
Total Stars | 9 |
% of votes with a positive feedback rating | 89% of 38 |
Total "Very Satisfied" Votes | 30 |
Total "Somewhat Satisfied" Votes | 8 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 44 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |