JS Ninjas Test

JS Ninjas Test

Assessment

Flashcard

Information Technology (IT)

Professional Development

Hard

Created by

Quizizz Content

FREE Resource

Student preview

quiz-placeholder

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.

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?