Search Header Logo

JavaScript Concepts Quiz

Mathematics

2nd Grade

JavaScript Concepts 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 the correct way to declare a variable in JavaScript?

`var myVariable;`

`variable myVariable;`

`v myVariable;`

`declare myVariable;`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to define a function in JavaScript?

`function myFunction() {}`

`def myFunction() {}`

`function: myFunction() {}`

`func myFunction() {}`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the `async` keyword in JavaScript?

To make a function run faster

To declare a function that returns a promise

To pause the execution of a function

To make a function synchronous

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to select an element by its ID in the DOM?

`document.getElementById()`

`document.querySelector()`

`document.getElementsByClassName()`

`document.getElementsByTagName()`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `map()` method do in JavaScript arrays?

It modifies the original array

It creates a new array with the results of calling a provided function on every element

It filters the array based on a condition

It sorts the array in ascending order

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you create a promise in JavaScript?

`let promise = new Promise();`

`let promise = Promise.create();`

`let promise = new Promise((resolve, reject) => {});`

`let promise = Promise();`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to add an event listener to a DOM element?

`element.addEventListener('click', function() {});`

`element.on('click', function() {});`

`element.listen('click', function() {});`

`element.event('click', 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?