wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Introduction to TypeScript

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

Who developed TypeScript?

a)

Google

b)

Microsoft

c)

Facebook

d)

Oracle

2.

TypeScript is a superset of:

a)

Python

b)

JavaScript

c)

Java

d)

PHP

3.

File extension of TypeScript files?

a)

.js

b)

.jsx

c)

.ts

d)

.json

4.

TypeScript code is:

a)

Directly executed in browser

b)

Converted into Java bytecode

c)

Compiled to JavaScript

d)

Executed only by Node.js

5.

One advantage of TypeScript is:

a)

No IntelliSense support

b)

Strong typing to prevent wrong values

c)

Runs faster than JavaScript

d)

No compilation needed

6.

Which feature is not in TypeScript?

a)

Static typing

b)

Interfaces

c)

IntelliSense support

d)

Direct execution without compilation

7.

Why testers use TypeScript?

a)

It replaces all test frameworks

b)

Detects errors before running tests

c)

It is faster than JavaScript

d)

It doesn’t need Node.js

8.

TypeScript works with:

a)

Only Jest

b)

Only Jest

c)

Playwright, Cypress, Jest, WebDriverIO, etc.

d)

Only Mocha

9.

First step before using TypeScript?

a)

Install Python

b)

Install Node.js

c)

Install Java

d)

Install Git

10.

Command to create new project folder and initialize?

a)

mkdir ts && cd ts && npm start

b)

mkdir ts-tests && cd ts-tests && npm init -y

c)

mkdir ts && npm install -g tsc

d)

npm new ts

11.

Command to install TypeScript & helpers locally?

a)

npm install typescript

b)

yarn add ts-node

c)

npm install --save-dev typescript ts-node @types/node

d)

npm install -g typescript

12.

Command to generate tsconfig.json?

a)

npm create tsconfig

b)

yarn init tsc

c)

npx tsc --init

d)

ts-node setup

13.

Command to run a .ts file directly?

a)

npm run ts

b)

node test.ts

c)

npx ts-node test.ts

d)

ts test.ts

14.

Why use ts-node?

a)

To initialize config

b)

To run TypeScript files without manual compilation

c)

To debug JavaScript

d)

To install Node.js

15.

@types/node package is used for:

a)

Debugging

b)

Type definitions for Node.js

c)

Running browser scripts

d)

Database connection

16.

Typing in JavaScript is:

a)

Strong

b)

Static

c)

Dynamic

d)

Hybrid

17.

Typing in TypeScript is:

a)

Weak

b)

Static (strict)

c)

Dynamic

d)

None

18.

Error detection in JavaScript happens:

a)

Compile-time

b)

Runtime only

c)

Never

d)

During installation

19.

Error detection in TypeScript happens:

a)

Never

b)

Runtime only

c)

Compile-time

d)

At debugging

20.

IntelliSense support in JavaScript is:

a)

Limited

b)

Full

c)

None

d)

Same as TypeScript

21.

IntelliSense support in TypeScript is:

a)

None

b)

Limited

c)

Full support

d)

Only in browsers

22.

Managing large projects in JavaScript is:

a)

Easy

b)

Harder

c)

Safer

d)

Strict

23.

Managing large projects in TypeScript is:

a)

Harder

b)

Easier & safer

c)

Riskier

d)

Impossible

24.

Which statement is correct?

a)

JavaScript is compiled to TypeScript

b)

TypeScript runs without compilation

c)

TypeScript is compiled into JavaScript

d)

JavaScript and TypeScript are unrelated

25.

Why TypeScript is better for testing?

a)

It runs faster than JS

b)

It catches errors early, has IntelliSense & strong typing

c)

It doesn’t need test frameworks

d)

It skips compilation