Question Bank

3705 approved questions from the community

In TypeScript, the `any` type completely bypasses type checking and should be avoided when possible.

EASY
TRUE FALSE
20s
TypeScript
by Mohamed

TypeScript interfaces can include both optional properties and readonly properties.

MEDIUM
TRUE FALSE
25s
TypeScript
by Mohamed

In TypeScript, `let` provides block-level scoping while `var` provides function-level or global scoping.

EASY
TRUE FALSE
25s
TypeScript
by Mohamed

TypeScript's type inference automatically determines variable types from their values, eliminating the need for explicit type annotations in many cases.

MEDIUM
TRUE FALSE
25s
TypeScript
by Mohamed

Abstract classes in TypeScript can be instantiated directly.

EASY
TRUE FALSE
20s
TypeScript
by Mohamed

Function overloading in TypeScript allows you to define multiple function signatures with different parameter types for the same function name.

MEDIUM
TRUE FALSE
30s
TypeScript
by Mohamed

Every valid JavaScript code is also valid TypeScript code.

EASY
TRUE FALSE
20s
TypeScript
by Mohamed

TypeScript code can run directly in web browsers without compilation.

EASY
TRUE FALSE
20s
TypeScript
by Mohamed

What are accessor functions (`get` and `set`) used for in TypeScript?

MEDIUM
SINGLE CHOICE
30s
TypeScript
by Mohamed

Which of the following are valid ways to declare arrays in TypeScript? (Select all that apply)

MEDIUM
MULTIPLE CHOICE
40s
TypeScript
by Mohamed

Which of the following are benefits of using TypeScript over JavaScript? (Select all that apply)

HARD
MULTIPLE CHOICE
45s
TypeScript
by Mohamed

What is the purpose of call signatures in TypeScript interfaces?

MEDIUM
SINGLE CHOICE
30s
TypeScript
by Mohamed

Which compiler options in `tsconfig.json` help enforce stricter type checking? (Select all that apply)

HARD
MULTIPLE CHOICE
45s
TypeScript
by Mohamed

Which of the following statements about TypeScript enums are correct? (Select all that apply)

MEDIUM
MULTIPLE CHOICE
40s
TypeScript
by Mohamed

Which keyword in TypeScript is used to declare a variable with block-level scope that cannot be reassigned?

EASY
SINGLE CHOICE
25s
TypeScript
by Mohamed

What is the return type of a function that doesn't return any value in TypeScript?

MEDIUM
SINGLE CHOICE
25s
TypeScript
by Mohamed

What symbol is used to denote an optional parameter in a TypeScript function?

EASY
SINGLE CHOICE
25s
TypeScript
by Mohamed

Which access modifier restricts member access to the declaring class and its subclasses in TypeScript?

MEDIUM
SINGLE CHOICE
30s
TypeScript
by Mohamed

What is the `never` type used for in TypeScript?

HARD
SINGLE CHOICE
35s
TypeScript
by Mohamed

What is a tuple in TypeScript?

MEDIUM
SINGLE CHOICE
30s
TypeScript
by Mohamed
PreviousPage 110 of 186Next