Re:Love for TypeScript
by gprasanth on Saturday July 30, 2016 @03:31AM
(#12192019)
What happens when x is 0?
[ Parent
| on HN ]
I think it's just the sample code needs to be x === null. Nothing to do with TypeScript. The sample is a good example to illustrate the union type.
On that note, are there any documentation that explains the == and === operators in Typescript ? The language spec is only briefly acknowledges the existence of those operators.
They behave exactly like they would in JavaScript.