In continuing with my recent trend of using TypeScript, I wanted to illustrate how to create functions and variables in TypeScript, because this initially threw me into a loop. The code for this example can be found here.
// float fRating // string sRating // object oRating
That can save you a lot of trouble in the end. Even so, I can accidentally pass in the wrong type, and the debugger won’t tell me. But with TypeScript, I don’t have that issue!
Here is an actual template that I’m using to generate some HTML for a container with biographical information about evangelists:
Here is that same code, but with TypeScript:
With TypeScript though, you have intellisense through type definitions, which I wrote about in-depth here.
David Catuhe, one of the engineers behind the open source WebGL project, BabylonJS, had a great blog post two years ago about why they made the switch to TypeScript as well.