Mastering TypeScript for JavaScript Users

Mastering TypeScript for JavaScript Users

12th Grade

15 Qs

quiz-placeholder

Similar activities

JavaScript Basics

JavaScript Basics

12th Grade - University

15 Qs

Gateway Level 3 Python Quiz 3

Gateway Level 3 Python Quiz 3

9th - 12th Grade

15 Qs

Exit Ticket 1/17

Exit Ticket 1/17

9th - 12th Grade

12 Qs

Do Now Lesson 2

Do Now Lesson 2

9th - 12th Grade

15 Qs

C# 101 Assessment

C# 101 Assessment

9th - 12th Grade

20 Qs

coding

coding

KG - Professional Development

15 Qs

BJC U2L1 Global vs. Local Variables

BJC U2L1 Global vs. Local Variables

10th Grade - University

11 Qs

Introduction to JavaScript

Introduction to JavaScript

9th - 12th Grade

20 Qs

Mastering TypeScript for JavaScript Users

Mastering TypeScript for JavaScript Users

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Tomas Martinez

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct file extension for a TypeScript file?

.js

.ts

.jsx

.tsx

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used in TypeScript to explicitly declare a variable's type?

typeof

type

as

:

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid TypeScript type?

string

number

boolean

digit

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default type assigned to a variable in TypeScript if no type is specified and no value is assigned?

string

any

undefined

object

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which TypeScript feature allows you to specify that a function parameter is optional?

Using the "?" after the parameter name

Using the "optional" keyword

Using the "maybe" keyword

Using the "!" after the parameter name

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following TypeScript code, what is the type of the variable `result`? ```typescript let result: number | string; ```

number only

string only

number or string

any

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the purpose of TypeScript interfaces?

To define the structure of objects

To perform mathematical operations

To create new data types at runtime

To handle asynchronous code

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?