I have a JSON object, like this:
var JSON =
[
{
"cat_function":"(function(){console.log('ITS HAPPENING');})();"
}
]
JSON[0].cat_function;
From my script, I need to load in the function and execute it. Simply calling JSON[0].cat_function
doesn't work, which I kinda expected; what's the best way to get this to run?
To clarify, this JSON data is coming from a CSV and the function is obviously more complex than just a console.log. The function is stored as a string and there's not much that can be done about it.
Any ideas?