The first code example he uses immediately threw me for a loop. Why is he adding the return value of a function call to a function itself? bar() + bar????
function bar(someNumber: number)
{
return foo(someNumber) + 1;
}
function baz(someNumber: number)
{
return bar(someNumber) + bar;
}
baz();
Moreover, baz is called with its only argument being undefined-- so the exception throwing code won't even throw, because it isn't 0. And _moreover_, this is typescript, so this would have thrown a type error since a required numeric argument is omitted.
This has so many problems. This is not a promising start to this article's correctness or thought-outtedness. Yet here it is at the top of hacker news...
function bar(someNumber: number)
{
}function baz(someNumber: number) {
}baz();
Moreover, baz is called with its only argument being undefined-- so the exception throwing code won't even throw, because it isn't 0. And _moreover_, this is typescript, so this would have thrown a type error since a required numeric argument is omitted.
This has so many problems. This is not a promising start to this article's correctness or thought-outtedness. Yet here it is at the top of hacker news...