I am just wondering if there is a way in JavaScript where I can create a new list of functions based on all "name" values in the object.
For example, with the following object:
var object_ = [{"name": "first_function", "child": ["1a", "1b"]},
{"name": "second_function", "child": ["2a", "2b"]},
{"name": "third_function", "child": ["3a", "3b"]}];
I would like to create the following functions:
function first_function(){
console.log("1a, 1b");
};
function second_function(){
console.log("2a, 2b");
};
function third_function(){
console.log("3a, 3b");
};
Thank you