TypeScript is a language, but the official implementation of TypeScript is the TypeScript compiler, tsc. Its job is simple: take TypeScript code, ensure it's valid, and then compile it into JavaScript code.
The compiler, tsc, has been written in TypeScript for a long time, but very recently, the TypeScript team has started a port to Golang! They've reported compilation speed improvements of ~10x, and I'm super excited about it.
TypeScript is not supported natively by most JavaScript engines, so it needs to be compiled into equivalent JavaScript code before it can be run. This interesting fact, that TypeScript code is only type-checked before it's run, has led to an interesting philosophical question:
Is TypeScript basically just a really good linter?
And honestly... yeah, I think so. I get it, technically it does a lot more than your standard linter, but from a practical perspective, its primary benefit is to do static analysis on your almost-JavaScript code and catch bugs before they happen.
TypeScript is interesting in that it's "compiled", but not in the traditional (compiled to binary) sense. Instead, it's compiled to JavaScript. So it's not really compiled for performance reasons, but rather for compatibility reasons.
The goal of TypeScript is to write JavaScript code that's easier to work with.
So, in this course, if your code fails to compile, you'll get an error like this:
tsc:
Type 'string' is not assignable to type 'number'.
Only if the compilation is successful, then we run the code. So your code needs to pass compilation, and needs to run correctly.
Run the code as-is. You should see a compilation error from tsc.
Fix the compilation error by changing the value of supportAiPort to the number 3000.