TypeScript for Beginners - Class Modules

TypeScript for Beginners - Class Modules

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial explains how to convert function-based modules into class-based modules. It covers the process of creating a class, exporting it, and using it in other parts of the program. The tutorial demonstrates how to create an instance of the class and use its methods, followed by compiling and running the program to achieve the same output as before.

Read more

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the first step in converting a function-based module to a class-based module?

Go to calcs and convert it

Create an instance of the class

Add the export keyword

Compile the program

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What should be removed from the functions when converting to a class-based module?

Keywords

Export statements

Brackets

Function names

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you export a class in a module?

By using the import keyword

By using the export keyword

By compiling the program

By creating an instance

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to import the calculator class?

import calculator from './calc'

import { calculator } from 'calc'

import calculator from 'calc'

import { calculator } from './calc'

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the final step after creating an instance of the class?

Compile and run the program

Go to calcs

Add the export keyword

Remove all keywords