
TypeScript Functions Quiz

Quiz
•
Instructional Technology
•
Professional Development
•
Hard
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
Similar Resources on Wayground
12 questions
Python Commands

Quiz
•
Professional Development
7 questions
ELT Session #3 - Quiz

Quiz
•
Professional Development
10 questions
AI & Pedagogy Test

Quiz
•
Professional Development
6 questions
FETCH

Quiz
•
Professional Development
13 questions
UNIT 1. TIPS OF USING THE INTERNET

Quiz
•
Professional Development
10 questions
Evaluación Sistemas Informáticos 19 de marzo

Quiz
•
Professional Development
10 questions
Flutter_Q5

Quiz
•
Professional Development
10 questions
Intro to Node.js

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade