The TypeScript Coding Guidelines state
Use undefined. Do not use null
Having just read another article on ECMAScrip
Why use null over undefined?
In javascripts objects are dynamic without any type information. therefor:
var person
person.namme
could either be a misspell or it could be the name
property. If you use undefined as null you won't know when debugging if:
Therefor null is preferable over undefined, you defer between:
That said: Typescript is typed. thus the following code:
var person
person.namme
would result in a type error at compilation. Thus null in that sense is no longer needed.
That said, i still prefer null over undefined.