Better HN
topnewbestaskshowjobs
Log inSign up

snugbug

4 karma · joined Nov 20, 2013 (13y ago) · 2 submissions

Submissions

comment 9y ago · link · parent

It is. I guess then you have to use the --strictNullChecks compiler flag to get the rest of the benefits

comment 9y ago · link · parent

I hope TS adds native Swift-style optional values and chaining, where it fails at compile time if you try to access an optional without unwrapping it first. Conversely non-optional values cannot be null!

There are projects that add optional functionality (https://www.npmjs.com/package/ts-optional), but I don't see how it prevents you from setting regular values to null.