JSFiddle - React, Tailwind, and code Playground

JavaScript

//This is variable you want to get the name
var prop;

var obj = {prop};
for(var propName in obj){
  alert(propName);
  break;
}