Is there a way to get a variable name as a string in Javascript? (like NSStringFromSelector in Cocoa)
I would like to do like this:
var myFirstName =
You can use the following solution to solve your problem:
const myFirstName = 'John' Object.keys({myFirstName})[0] // returns "myFirstName"