I have following string which needs to be parsed using JS.
function () {\n MyClass.prototype.doSomethingFunction();\n 5-6 lines of coding\n }
I tried parsing it, trimming whitespaces and newlines but nothing worked for me. Please let me know how can I get function name (doSomethingFunction) from the above string.
How I'm getting this string:
I have a queue where my functions are stored. Later in time my code picks a function from this queue (some logic here) and execute them. It works perfectly ok for me. But I just want to print the name of the function out of it! It's like '(classOBJ.myFunctionsQueue[n])()' is used to execute a function which is stored at nth location in myFunctionsQueue array. Make sense or I'm doing something wrong in here?
Thanks MANN
["doSomethingFunction", "function () {\n... "].