Is there a way to get method name and passed in parameter in javascript?
let
function say(param){
alert(param);
}
so when say method is invoked,
say("helloworld")
I would get method: 'say' and parameters: {'helloworld'}
Is there a way to get method name and passed in parameter in javascript?
let
function say(param){
alert(param);
}
so when say method is invoked,
say("helloworld")
I would get method: 'say' and parameters: {'helloworld'}
function say() {
var args = Array.prototype.slice.call(arguments);
console.log("method:" + arguments.callee.name + " parameters: {" + JSON.stringify(args) + "}");
}
function say(param){
alert("method: " + arguments.callee.name + " and parameters : "+param);
}