Yes, you can do it:
function getVariableName(v) {
for (var key in window) {
if (window[key] === v)
return key;
}
}
var abc = '123';
var def = '456'
alert ("value of " + getVariableName(abc) +" is "+ abc +" and value of " + getVariableName(def) + " is " + def);