TypeScript Functions Quiz

TypeScript Functions Quiz

Professional Development

10 Qs

quiz-placeholder

Similar activities

Audio Basics Quiz

Audio Basics Quiz

Professional Development

9 Qs

SFRP April 2024 Knowledge Check

SFRP April 2024 Knowledge Check

Professional Development

10 Qs

Spreadsheets (Microsoft Excel vs Google Sheets)

Spreadsheets (Microsoft Excel vs Google Sheets)

Professional Development

10 Qs

JS - Conditional Statements

JS - Conditional Statements

Professional Development

10 Qs

HTML and CSS Quiz

HTML and CSS Quiz

Professional Development

15 Qs

Zoom Cafe EP4

Zoom Cafe EP4

Professional Development

13 Qs

JS-DOM

JS-DOM

Professional Development

10 Qs

Quiz on Prompts in AI

Quiz on Prompts in AI

Professional Development

10 Qs

TypeScript Functions Quiz

TypeScript Functions Quiz

Assessment

Quiz

Instructional Technology

Professional Development

Hard

Created by

A Lakshman

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the return type of the function 'greet'?

void

boolean

number

string

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid parameter type in TypeScript?

string

float

text

integer

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the '?' signify in the function 'log'?

It indicates an optional parameter.

It indicates a default value.

It indicates a required parameter.

It indicates a return type.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'add' function?

To subtract two numbers.

To concatenate two strings.

To return the sum of two numbers.

To log a message.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the function 'subtract', what are the types of parameters x and y?

string

boolean

number

void

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How would you define a function that takes two numbers and returns their product?

function multiply(a: number, b: number): number { return a * b; }

function multiply(a: string, b: string): number { return a * b; }

function multiply(a: number, b: number): boolean { return a * b; }

function multiply(a: number, b: number): void { return a * b; }

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the function 'log' if called with 'Hello' and 'INFO'?

Hello

[DEBUG] Hello

[INFO] Hello

[ERROR] Hello

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?