User FAQs

If you have a question, please send it to us.


1) What is TypeScript ?
TypeScript is a superset of JavaScript and uses the file extensions ".ts" and ".tsx".
TypeScript comes with the tsc compiler that compiles your code to ES 2009 (ES5) and creates the *.d.ts files that contain your type declarations.
TypeScript includes a lot of features found in ES 2015 plus some extra stuff (eg Interfaces)


2) What is ts-loader ?
This is a webpack plugin that can load Typescript.

ts-loader 

3) What is the 'omit' type ?


4) When would you need to use the 'declare' keyword ?


5) How can you get 'declaration files' automatically ?
Set the declaration option to true in the tsconfig.json file


6) How can you overload a function ?


7) How can you make all the properties of an interface optional ?


8) Where can decorators be applied ?
Classes, properties, methods and metho arguments


9) What is the 'Record' type ?


10) When would you use the 'unknown' keyword ?


11) What is a '.map' file and when would you use it ?
This can be used when you are debugging
This file can be generated by setting the sourceMap option to true in the tsconfig.json file


12) Should I use the data types Number, String, Boolean or Symbol ?
No. These keywords refer to the non-primitive boxed objects.
Always use the primitive data types instead (number, string, boolean and symbol).


13) What is the difference between String and string ?
String refers to an object instance that has a string data type.
string is a javascript primitive data type.

var str1: string 
var str2: String


© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext