Search Header Logo

JavaScript Quiz

Authored by vaibhavi patel

Other

University

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 does the alert() function do in JavaScript?

Takes user input

Displays a message box

Prints to the console

Reloads the page

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to take text input from the user?

alert()

confirm()

prompt()

log()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the return type of confirm() in JavaScript?

String

Number

Boolean

Object

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct example of an arrow function?

function() => {}

() => {}

function => () {}

=> function()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will typeof "5" return in JavaScript?

number

string

boolean

undefined

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to compare both value and type in JavaScript?

=

==

===

!=

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of the Document Object Model (DOM)?

Styling HTML

Designing images

Representing and interacting with HTML elements

Downloading pages

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?