return its variable name if undefined code example
Example: how to check if object is undefined in javascript
if (typeof something === "undefined") {
alert("something is undefined");
}
if (typeof something === "undefined") {
alert("something is undefined");
}