Search Header Logo

JavaScript Quiz

Authored by Raja SK

Computers

12th Grade

Used 1+ times

JavaScript Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is prototype inheritance in JavaScript?

It allows objects to inherit properties and methods from other objects.

It is a method for accessing elements in an array in JavaScript

It is a feature for defining classes in JavaScript

It is used to create new objects in JavaScript

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you achieve inheritance in JS?

Using prototype

Using promises

Using object

No inheritance in JS

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a Promise in JavaScript?

A type of function in JavaScript

A built-in method for sorting arrays in JavaScript

A keyword used to declare variables in JavaScript

An object representing the eventual completion or failure of an asynchronous operation.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you handle asynchronous operations using Promises in JavaScript?

Use setTimeout to handle asynchronous operations

Create a new Promise object and use the resolve and reject functions to handle the success and failure of the asynchronous operation.

none of the above

Use try and catch blocks to handle asynchronous operations

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the states of a Promise in JavaScript?

open, closed, and finished

started, completed, and failed

pending, fulfilled, and rejected

waiting, approved, and denied

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is async/await in JavaScript?

It is a feature that is only used for debugging purposes.

It is a feature that has no impact on the way code is executed.

It is a feature that allows you to write asynchronous code in a synchronous manner.

It is a feature that allows you to write synchronous code in an asynchronous manner.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you use async/await with try/catch in JavaScript?

Use the try/catch block to handle errors within the async function.

Use switch/case statements to handle errors within the async function.

Use a for loop to handle errors within the async function.

Use if/else statements to handle errors within the async function.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?