js variable name with variable code example
Example 1: get variable name javascript
const myFirstName = 'John'
Object.keys({myFirstName})[0]
// returns "myFirstName"
Example 2: js var part of var name
var name = "nameofvar";
eval('var ' + name + ' = valueofvar')