

JS Ninjas Test
Flashcard
•
Information Technology (IT)
•
Professional Development
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

35 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Which of the following is a valid TypeScript data type? Options: number, bigint, symbol, all of the above
Back
all of the above
Answer explanation
TypeScript supports number, bigint, and symbol as valid data types.
2.
FLASHCARD QUESTION
Front
What does the 'readonly' keyword do in TypeScript?
Back
Makes a variable immutable and prevents reassignment.
Answer explanation
readonly' ensures the value cannot be modified after initialization.
3.
FLASHCARD QUESTION
Front
Which utility type makes all properties of a TypeScript interface optional? Options: Partial<T>, Required<T>, Readonly<T>, Pick<T, K>
Back
Partial<T>
Answer explanation
Partial<T> makes all properties optional.
4.
FLASHCARD QUESTION
Front
What is the difference between 'interface' and 'type' in TypeScript?
Back
Interfaces can be extended, types cannot; Types allow unions, interfaces do not.
Answer explanation
Interfaces can be extended and types support unions.
5.
FLASHCARD QUESTION
Front
Which of the following is a new JavaScript feature introduced in ES2022? Top-level await, Private class fields, Optional chaining, WeakRef
Back
Top-level await
Answer explanation
Top-level await was introduced in ES2022.
6.
FLASHCARD QUESTION
Front
What does 'as const' do in TypeScript?
Back
Makes the variable a readonly tuple, freezes the object, and makes it a literal type.
Answer explanation
as const' ensures values are inferred as literals and readonly.
7.
FLASHCARD QUESTION
Front
What is a difference between '==' and '===' in JavaScript?
Back
'===' checks type and value, '==' does type coercion.
Answer explanation
==' performs type coercion while '===' does not.
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 Microsoft
or continue with
%20(1).png)
Apple
Others
Already have an account?