0% found this document useful (0 votes)
2K views

Typescript MCQs

Typescript is a language that compiles to JavaScript. It adds optional static typing and classes to JavaScript to help catch errors. The file extension for Typescript files is .ts. The tsc command is used to compile Typescript code to JavaScript. Typescript supports object-oriented principles like inheritance, abstraction, and polymorphism. Typescript performs type checking at compile time rather than runtime.

Uploaded by

SAAD MEHMOOD
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Typescript MCQs

Typescript is a language that compiles to JavaScript. It adds optional static typing and classes to JavaScript to help catch errors. The file extension for Typescript files is .ts. The tsc command is used to compile Typescript code to JavaScript. Typescript supports object-oriented principles like inheritance, abstraction, and polymorphism. Typescript performs type checking at compile time rather than runtime.

Uploaded by

SAAD MEHMOOD
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Typescript

Select the correct answer to following multiple choice questions.

1) What is extension for typescript file?


a)abc.js b) abc.ts c) abc.tsc d)none of the
above

2) Which of the following is valid command to compile typescript file?


a) ts abc.ts b) tsc abc.ts c) tsc abc d)none of the
above

3) TypeScript is alibrary which is backed primarily by


a)Google b)Microsoft c)Facebook d)IBM

4) TypeScript compile down to


a)C++ b)Java c)Javascript d)Html

5) Class keywork is:


a)feature of b)feature of c)both a and b d)none of the
javascript typescript above

6) Which of the following is not true about typescript?


a) It supports b)It supports c)It supports d)none of the
inheritance abstract classes. interfaces. above

7) Which of the following is correct way of inheriting in typescript?


a)class B:A{} b)class B inherits c)class B extends d)none of the
A{} A{} above

8) What is role of constructor keyword?


a) No such b)It is used to call c)It is used to d)none of the
keyword exist in constructor of an define constructor above
typescript instance. for class

9) Can we use old plain javascript in typescript?


a)Yes b)No c)Dont know d)none of the
above

10) Which keyword is used to define class in typescript?


a)Class b)Function c)Prototype d)Closure

11) How to define method of class in typescript?


a)function b) func myFunc() {} c)myFunc() {} d)none of the
myFunc() {} above

12) Typescript support all object oriented principle


a)True b)False c)Dont know d)none of the
above
13) Typescript provides type checking at
a)run time b)compile time c)load time d)none of the
above

14) Typescript complier use _________ to check type when type is not given
a)type erasure b)type inference c)type annotations d)none of the
above

15) Typescript is ________ of javascript


a)subset b)superset c)both of above d)none of the
above

You might also like