GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript-notes/09-types-null-undefined.md at master · geekysrm/javascript-notes

Expand file tree

/

09-types-null-undefined.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
21 lines (13 loc) · 526 Bytes
/

09-types-null-undefined.md

Copy path

File metadata and controls

21 lines (13 loc) · 526 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

Null and Undefined

  • Used to express 'nothing' in JavaScript.

  • If we declare a variable, and don't set anything to it, then it has value undefined.

      let dog;
      console.log(dog); // undefined

    When we try to access a variable that is created but not defined/set a value, we get undefined.

  • null: value of nothing

      const somethingNull = null;
      // we have explicitly set the value to be nothing with null
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.