this is my code
var javascriptCode="function adding(a,b){ return a+b}"
and i want to pick functionName adding from that string how to do that?
i have tried by finding its index as
var indexStart=javascriptCode.indexOf("function ");
var indexEnd=javascriptCode.indexOf("(");
var res = javascriptCode.substring(indexStart, indexEnd);
but i am getting the output as
function adding, is their any other way to do this