The short answer is: it depends. With TS you can choose how much type "soundness" you want. The --strict option is very useful[1], but even having it enabled you can still choose to explicitly type something as `any`, and bypass the typechecker if you want.
Something to note though: the example given in the article is not showing any problem in TS. That's how its structural type system works. Both Animal and Bird classes don't have any properties, so the type of their instances is the same as `{}`. If you change the Bird class to something like:
class Bird extends Animal {
song: string
}
Then the line that tries to push a `new Animal` into an Array<Bird> will not type-check, because the types are invalid :)
Something to note though: the example given in the article is not showing any problem in TS. That's how its structural type system works. Both Animal and Bird classes don't have any properties, so the type of their instances is the same as `{}`. If you change the Bird class to something like:
Then the line that tries to push a `new Animal` into an Array<Bird> will not type-check, because the types are invalid :)[1]: https://www.typescriptlang.org/docs/handbook/compiler-option...