Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

15. Undefined > JavaScript ECMAScript 3 Edition (and Later) Declares the undefi...

JavaScript ECMAScript 3 Edition (and Later) Declares the undefined Variable in the Global Scope

Unlike previous versions, JavaScript ECMAScript 3 Edition (and later) has a global variable called undefined declared in the global scope. Because the variable is declared, and not assigned a value, the undefined variable is set to undefined.

Live Code

<!DOCTYPE html><html lang="en"><body><script>

// confirm that undefined is a property of the global scope
console.log(undefined in this); // logs true

</script></body></html>

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint