JS

TypeScript Quiz - Review

Review

Discover your progress and identify completed questions and those awaiting your input. Dive back into any unanswered quizzes, refine your knowledge, and keep track of your learning journey with ease!

No.QuestionStatus
Q1What is `TypeScript`?
Q2What is the type of `animal` in the code example below? ``` const animal: string = "lion"; ...
Q3What will be output to the console after the following code is executed? Will any type errors o...
Q4What is the problem with the following code? ``` function greet(name: string, age: number):...
Q5Will the following assignments generate any type errors? ``` let num: number = 5; let...
Q6Will the following assignments generate any type errors? ``` let num: number = 5; le...
Q7We have a variable that will hold a two-dimensional point (GPS Coordinates: latitude and longit...
Q8We have a function below that takes in a varying number of message parameters and outputs them ...
Q9What will TypeScript infer the type of the `people` variable to be in the declaration below? `...
Q10What is the correct syntax for creating an array of numbers in TypeScript?
Q11What is the correct type of annotation for creating an array of dates?
Q12What is the return type in the function below? ```typescript function add(a: number, b: num...
Q13Will TypeScript detect a problem with the following code? If so, what's the problem? ```type...
Q14Will TypeScript detect a problem with the following code? If so, what's the problem? ```type...
Q15What is the type of the message parameter in the following function? ```typescript function...
Q16Which of the following types is the type of the message parameter in the following function? ...
Q17What is the type of the parameter in the following function declaration: `function ex(param1?: ...
Q18What is the return type for when nothing is returned in TypeScript?
Q19What is `Definitely Typed`?
Q20In TypeScript, when a numeric enum is defined without assigning a value to its first member, wh...
Q21What are the two types of enums in TypeScript?
Q22What is the inherited type for the variable greet in `const greet = ['Hello World!']`?
Q23What is similar to `any`, but a safer alternative when uncertain about the type?
Q24Which TypeScript compiler option can be used to disable implicit variable type assignment?
Q25Which data type in TypeScript is used to represent a collection of elements?
Q26What type of assignment is this variable, `const age: number = 30;`?
Q27What are the three main 'simple types' in TypeScript?
Q28How are type annotations used in TypeScript?
Q29How does TypeScript relate to JavaScript?
Q30What is the main benefit of using TypeScript in a project?