Is it possible to get the name of the variable passed in as an argument from inside of the function, if a variable has been passed in?
function foo(bar){
// how to get the string `obj`?
}
const obj = {a:1};
foo(obj)
Is it possible to get the name of the variable passed in as an argument from inside of the function, if a variable has been passed in?
function foo(bar){
// how to get the string `obj`?
}
const obj = {a:1};
foo(obj)