Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Lesson 12: null vs undefined

Two ways to represent 'nothing'.

What you'll learn

  • undefined — a variable was declared but not assigned; missing property; no return
  • null — an intentional 'empty' value you set yourself
  • null == undefined is true; null === undefined is false
  • use ?? to default only on null/undefined

Example

See examples/.

Exercise

Explain when you'd return null vs undefined from a function.