Skip to content

Should I use null and not undefined for nullable properties? #1931

Discussion options

You must be logged in to vote

It's just a convention and, IMO, a good practice:

  • null: intentionally doesn't exist/empty
  • undefined: still hasn't been given a value

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vatosarmat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants