Two main ways
- Via npm
- By installing TypeScript's Visual Studio plugins
Back
What is the syntax used for declaring the type of a variable?
Front
variableName:type
Back
What is the purpose of the 'tsconfig.json' file?
Front
it allows you to specify the root level files and the compiler options that requires to compile a TS file
Back
How are TypeScript and JavaScript related to one another?
Front
- TS adopts the basic building blocks of your program from JS
- All TS code is converted into its JS equivalent for the purpose of execution
- Any valid .js file can be renamed to .ts and compiled with other TS files
Back
What is TypeScript?
Front
- TypeScript is JS for application-scale development
- It is a strongly typed, object-oriented, compiled language
- it is a typed superset of JS compiled to JS
- In other words, TS is JS plus some additional features
Back
What is the syntax used for casting a value into another type?
Front
Use 'as' to cast a value into another type
Back
By default, what version of JS does TS transpile into? How can you change this?
Front
- ES3
- tsconfig.json specify the version you'd like it to transpile to
Back
What are some features in TS that are not present in JS?
Front
- TS has a feature known as Static typing
- TS gives support for modules
- TS has interface
- TS supports optional parameter function
Back
What is the syntax used for declaring the return type of a function?
Front
Use a fat arrow (=>) between the parameters and the return type