TypeScript Senior

1 / 10

What is transpilation?

Select the correct answer

1

Transpilation is the process of converting TypeScript code to JavaScript code.

2

Transpilation is the process of minifying JavaScript code.

3

Transpilation is the process of bundling multiple JavaScript files into one.

4

Transpilation is the process of debugging TypeScript code.

What is a generic type in TypeScript?

Select the correct answer

1

A generic type in TypeScript is a type that can only be a string or number.

2

A generic type in TypeScript is used for error handling.

3

A generic type in TypeScript is used to define specific types of variables.

4

A generic type in TypeScript allows a type to be a parameter when defining classes, interfaces, and functions.

What are triple-slash directives?

Select the correct answer

1

Triple-slash directives in TypeScript are comments for declaring global variables.

2

Triple-slash directives in TypeScript are comments that contain a single XML tag used to provide additional information to the compiler.

3

Triple-slash directives in TypeScript are used to handle errors.

4

Triple-slash directives in TypeScript are used for defining types.

What is an abstract class in TypeScript, and how is it different from a regular class?

Select the correct answer

1

An abstract class in TypeScript is used for defining interfaces.

2

An abstract class in TypeScript is a class that has only static methods.

3

An abstract class in TypeScript is a class that cannot extend other classes.

4

An abstract class in TypeScript is a class that cannot be instantiated and is meant to be subclassed.

Explain "module resolution" in TypeScript.

Select the correct answer

1

Module resolution in TypeScript is the process of managing state.

2

Module resolution in TypeScript is the process the compiler uses to find the actual location of modules.

3

Module resolution in TypeScript is the process of defining module types.

4

Module resolution in TypeScript is the process of handling async operations.

Explain the symbol type in TypeScript.

Select the correct answer

1

The symbol type in TypeScript is a data type for storing numbers.

2

The symbol type in TypeScript is used for defining arrays.

3

The symbol type in TypeScript is used for string manipulation.

4

The symbol type in TypeScript is a primitive data type that represents a unique identifier.

What is the difference between extends and implements in TypeScript?

Select the correct answer

1

The extends keyword in TypeScript is used for creating arrays, whereas implements is used for object creation.

2

The extends keyword in TypeScript is used for variable declaration, whereas implements is used for function declarations.

3

The extends keyword in TypeScript is used for function overloading, whereas implements is used for type assertions.

4

The extends keyword in TypeScript is used for class inheritance, whereas implements is used to implement interfaces.

What are namespaces in TypeScript?

Select the correct answer

1

Namespaces in TypeScript are used to organize code into logical groups and prevent name collisions.

2

Namespaces in TypeScript are used for error handling.

3

Namespaces in TypeScript are used to create modules.

4

Namespaces in TypeScript are used to define new types.

Name the two primary types of modules in TypeScript?

Select the correct answer

1

The two primary types of modules in TypeScript are class modules and function modules.

2

The two primary types of modules in TypeScript are synchronous modules and asynchronous modules.

3

The two primary types of modules in TypeScript are global modules and local modules.

4

The two primary types of modules in TypeScript are ES6 modules and CommonJS modules.

Explain modules in TypeScript.

Select the correct answer

1

Modules in TypeScript are used to define types.

2

Modules in TypeScript are used for error handling.

3

Modules in TypeScript are a way to declare variables.

4

Modules in TypeScript are used to organize code into reusable pieces.