It must be something easy; however I cannot find it...
function isDOM(obj)
{
if (obj.nodeType!==undefined)
console.log(obj,' is DOM element');
else
console.log(obj,' is not DOM element');
}
The above function checks if object obj is a member or not of DOM. However, I want a reply like that:
document.body is DOM element
by calling isDOM(document.body);
How may I catch the string 'document.body' as to pass it inside console.log and get exactly the argument name to the console?
Thank you