function printVariableName(name){
console.log()//Here variable name should be printed...
}
Asked
Active
Viewed 39 times
0

Suresh Kamrushi
- 15,627
- 13
- 75
- 90

Tejas R
- 1
-
Can you elaborate on why you need to have the string representation of the name of an instance variable...? – esqew Mar 10 '21 at 05:41
-
2Duplicate of [Variable name as a string in Javascript](https://stackoverflow.com/questions/4602141/variable-name-as-a-string-in-javascript) – esqew Mar 10 '21 at 05:41
-
I think this is the answer as well: https://stackoverflow.com/questions/47468361/get-variable-name-into-string-in-javascript/47468674 – Miu Mar 10 '21 at 05:47