how to check if an object from database is undefined in javascript

JavaScript
if (typeof something === "undefined") {
  alert("underfine")
}
Source

Also in JavaScript: