javascript - how to get a value which points to a function -


I have such a value

  var myvalue = myfunction (1,2);  

What do I need is that myfunction (a, b) is happening in the form of a string

I do not mean "myfunction's

return 1 + 2 = 3

If I type

  warnings (myvalue)  

it returns 3 , but I Myfunction (a, b) as I typed when using the warning

  var myvalue = 'myfunction (a, b)'  
< P> Now, if I use Warning, it ups me up Defense gives work (A, B)

I can do this?

var myvalue = function () {myfunction (1,2); };

myvalue is an anonymous function that calls myfunction with the specified parameter. You can call it, and if you print it for debugging, then something like this will appear:

  function () {myfunction (1, 2); }  

Comments