I'm trying to figure out whether it is possible to get object name out of variable that is just pointing to it.
So lets say I have code like this:
var myObj = {
content: "this is my object"
}
var pointer = myObj;
// any way to get "myObj" string from "pointer" variable?
var myFunc = function(parameter) {
console.log(parameter)
// any way to get "myObj" string from "parameter" variable inside function?
}
myFunc(myObj)
Any way to get original object name in Javascript as string rather than object itself?
Can it be done some other way if above methods cannot be used?