Q: get function name and its parameters passed to a function Let's say I have a display function which I want to use it as follows:
display(min(1,10))

//expected output
min(1,10)

I am not able to get the name of the function and its parameters as is from the arguments object. I have started out like this.
function display() {
    return arguments[0];
}

display(min(1,10));

//expected output
min(1,10)

//actual output
1

I understand that the min function is getting evaluated and its value is being taken as the first argument.
Short of wrapping the min function inside quotes, is there nothing we can do to get the passed function name and its parameters?
display('min(1,10)');

//expected output
min(1,10)

//actual output
min(1,10)


A: 
I understand that the min function is getting evaluated and its value is being taken as the first argument.

Correct.

Short of wrapping the min function inside quotes, is there nothing we can do to get the passed function name and its parameters?

No, nothing. By the time the value gets to display, there is nothing about it that associates it with where it came from (the result of calling min(1, 10)).

A: 

function min(a,b){
return 1;
}
function display() {
    return arguments[0];
}

console.log(display(min));


min(1,10) will return the value first then it will go into display function.
