7 kyu
Run your String
1,555VoodooLab
Description:
- Function should accept two arguments:
arg: any type
object with properties:
- param: string type.
- func: string type. This string is a body of executable function
- Function should evaluate code of string passed as 'func' with parameter arg passed as argument and return result of execution
Example:
var arg = 4, // arg for "string" function call
obj = {
param: 'num', // parameter name for function in string
func: 'return Math.sqrt(num)' // function that need call with arg var
};
runYourString(arg, obj) // we expect it should return 2 which is a result of square root of 4
ps: Solution of this Kata just fun language trick.
Usage of this code in production is not recommended.
Strings
Fundamentals
Similar Kata:
Stats:
Created | Jan 30, 2015 |
Published | Jan 30, 2015 |
Warriors Trained | 2760 |
Total Skips | 262 |
Total Code Submissions | 9202 |
Total Times Completed | 1555 |
JavaScript Completions | 1555 |
Total Stars | 43 |
% of votes with a positive feedback rating | 84% of 150 |
Total "Very Satisfied" Votes | 114 |
Total "Somewhat Satisfied" Votes | 24 |
Total "Not Satisfied" Votes | 12 |