TypeScript MCQ Questions And Answers
TypeScript MCQ : This section focuses on "Basics" of TypeScript. These Multiple Choice Questions (MCQ) should be practiced to improve the TypeScript skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. TypeScript is a ?
A. strongly typed
B. object oriented
C. compiled language
D. All of the above
View Answer
Ans : D
Explanation: TypeScript is a strongly typed, object oriented, compiled language. It was designed by Anders Hejlsberg (designer of C#) at Microsoft.
2. Which of the following are features of typeScript?
A. TypeScript is just JavaScript
B. TypeScript supports other JS libraries
C. TypeScript is portable
D. All of the above
View Answer
Ans : D
Explanation: All of the above are the Features of TypeScript.
3. Extension of typescript is?
A. .d.ty
B. .d.tp
C. .d.ts
D. .d.td
View Answer
Ans : C
Explanation: TypeScript Definition file (with .d.ts extension) provides definition for external JavaScript libraries.
4. TypeScript supports Object Oriented Programming concepts like classes, interfaces, inheritance.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: TypeScript supports Object Oriented Programming concepts like classes, interfaces, inheritance.
5. How many components typescript has?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : B
Explanation: At its heart, TypeScript has the following three components : Language, The TypeScript Compiler and The TypeScript Language Service.
6. TypeScript is ?
A. case-sensitive
B. Case-insensitive
C. depends on typescript version
D. Can not say
View Answer
Ans : A
Explanation: TypeScript is case-sensitive. This means that TypeScript differentiates between uppercase and lowercase characters.
7. TypeScript supports how many types of comments?
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : B
Explanation: TypeScript supports the following types of comments : Single-line comments And Multi-line comments.
8. According to Grady Brooch, every object must have _________ features.
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : C
Explanation: According to Grady Brooch, every object must have three features : State, Behavior and Identity.
9. A ________ in terms of OOP is a blueprint for creating objects.
A. constructor
B. method
C. function
D. class
View Answer
Ans : D
Explanation: A class in terms of OOP is a blueprint for creating objects. A class encapsulates data for the object.
10. Semicolons are optional in TypeScript.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Semicolons are optional in TypeScript.
Discussion