I don’t believe it is possible but if anyone knows how to convert a variable name into a string representation please let me know. Thanks.
For example (purely for illustration purposes as this is not exactly the code):
[CODE]
var theVar = “123”;
doSomething(theVar); // this should result in a call to doSomethingNew()
var theOtherVar = “456”;
doSomething(theOtherVar); // this should result in a call to dontDoSomethingNew()
function doSomething(myVar) {
var simpleVar = “theVar”;
// TO DO: get the name of the variable in String
var testStrVar = myVar.convertString(); // pseudo code as I don’t know exact syntax if any to do this
if (testStrVar == simpleVar) {
doSomethingNew();
} else {
dontDoSomethingNew();
}
}