
TypeScript basics 1
Authored by Artem Shamsutdinov
Computers
5th Grade - University
15 Questions
Used 32+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How does a TypeScript class implement an interface?
class MyCoolClass implements IMyCoolInterface {
}
class MyCoolClass extends IMyCoolInterface {
}
interface IMyCoolInterface implemented by MyCoolClass {
}
A class implements an interface automatically.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
2) What is the benefit of interfaces?
They let you hide what the class is and reference an object via the interface.
They let you define inline-objects with type safety, like so:
let myObject: IMyCoolInterface = {
myCoolVariable: 1
}
They let you change assign a different class to a variable as long as it implements the same interface.
All of the above.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
TypeScript is all about specifying what type your variable or return value is. Is is possible to define
a variable in TypeScript without a type? Like so:
let a
and not:
let a: number
Yes type is optional (for interoperability with JavaScript)
No, type is always required (knowing types always helps prevent bugs)
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What type of variable is this:
var version: {
subVersion: number
};
boolean
number
object
string
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is a difference between the following:
let a = 0;
const a = 0;
"const a" can be reassigned. "let a" cannot be reassigned.
"let a" can be reassigned. "const a" cannot be reassigned.
There is no difference
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you declare a variable inside a class?
class MyCoolClass {
let myCoolVariable;
}
class MyCoolClass {
myCoolVariable;
}
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you declare a method inside a class?
class MyCoolClass {
function myCoolMethod() {
}
}
class MyCoolClass {
myCoolMethod() {
}
}
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
DNS dan Web server
Quiz
•
11th Grade
20 questions
Round 1 ( RHA Learner Contest )
Quiz
•
University
10 questions
Basic Parts of Speech EPS
Quiz
•
9th - 10th Grade
10 questions
Planning and Implementation of Information Security
Quiz
•
University
15 questions
LEDs on micro:bit
Quiz
•
8th Grade
20 questions
Lesson 5 Sharing Information on the Web
Quiz
•
7th Grade
20 questions
Network topologies
Quiz
•
8th Grade - University
10 questions
Introduction to Operating System
Quiz
•
5th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade