JavaScript Quiz

JavaScript Quiz

University

10 Qs

quiz-placeholder

Similar activities

HTML and Git Quiz

HTML and Git Quiz

6th Grade - University

15 Qs

Java Arrays

Java Arrays

5th Grade - University

10 Qs

deer

deer

1st Grade - University

8 Qs

Data Structure 1

Data Structure 1

University

10 Qs

 Quiz-4: Function & Array

Quiz-4: Function & Array

University

15 Qs

CAT1 W8 Quiz

CAT1 W8 Quiz

University

10 Qs

Computer Science

Computer Science

University

10 Qs

Suprize Test - 6.10.2022

Suprize Test - 6.10.2022

University

10 Qs

JavaScript Quiz

JavaScript Quiz

Assessment

Quiz

Other

University

Medium

Created by

Gnaneshwar Reddy

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does document.getElementById("demo") do?

Changes the class of an element

Adds a new element

Selects an element with ID "demo"

Removes an element

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method adds a click event listener to a button?

button.listen("click")

button.addEvent("click", function)

button.addEventListener("click", function)

button.onClick(function)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will [].forEach() do in JavaScript?

Modify the array directly

Create a new array

Loop through each element

Remove elements from the array

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method returns a new array with transformed values?

filter()

map()

forEach()

reduce()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of typeof null in JavaScript?

"null"

"undefined"

"object"

"nulltype"

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct if statement?

if x == 5:

if x = 5

if (x == 5) {}

if x = 5 {}

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does filter() return?

A boolean

A single value

A modified original array

A new array with filtered elements

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?