Calling pickCard with any other parameter types would cause an error. There is so much more that classes and interfaces can do too, as Dan and I show in our TypeScript course at Pluralsight. Creating an interface in TypeScript is extremely simple. But it's so ridiculously useful that I think this single deviation would be justified. I'm clearly a little biased towards the latter. The more loose the typescript is, the easier it is to manage but there might be a lot of suppressed errors that may end up being runtime errors because of loose typings.
An easier way to play with the language is just to go to. Creating a Class You can create a class and even add fields, properties, constructors, and functions static, prototype, instance based. Examples Here are some examples of optional chaining in action using both of these functions. Inside the constructor the engine property is referred to using the this keyword. This feature cannot work properly without static typing anyway.