I have not used TypeScript, so can anyone explain to me what is the difference between the above the normal JavaScript code like this:
function myFunction(x) {
if (x === null) {
return;
}
console.log(x + 1); // x is now a number
}
Edit: Or is this example being used to show that TypeScript now support multiple types including null in the parameter?I assumed that such feature would be available by default.