wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

7/2/2024

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

What is the result of the following expression: `3 + 2 + '7'`?

a)

57

b)

12

c)

327

d)

nan

2.

what will the following code output?

console.log(2 + '2' - 1);

a)

12

b)

21

c)

nan

d)

3

3.

forEach is a javascript array method that returns an array

a)

TRUE

b)

FALSE

4.

Inside which HTML element do we put the JavaScript?

a)

<js>

b)

<javascript>

c)

<scripting>

d)

<script>

5.

what would be the result of the following code
console.log(0.1 + 0.2 === 0.3)

a)

true

b)

false

c)

undefined

d)

nan

6.

How do you handle the response from a Fetch request?

a)

Using the .response() method

b)

Using the .then() method

c)

Using the .catch() method

d)

Using the .resolve() method

7.

The external JavaScript file must contain the <script> tag.

a)

TRUE

b)

FALSE

8.

How do you write "Hello World" in an alert box?


a)

alert("Hello World");

b)

alertBox("Hello World");

c)

msg("Hello World");

d)

msgBox("Hello World");

9.

How can you add a comment in a JavaScript?


a)

//This is a comment

b)

<!--This is a comment-->

c)

'This is a comment''

10.

How to insert a comment that has more than one line?


a)

/*This comment has
more than one line*/

b)

<!--This comment has
more than one line-->

c)

//This comment has
more than one line//

d)

using the .finally() method