wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JavaScript 'this' Keyword Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is the output? (Executed in browser, non-strict mode)

console.log(this);

a)

undefined

b)

{}

c)

window object

d)

null

2.

What is the output?

a)

undefined

b)

Global object

c)

Error

d)

The function itself

3.

What will be logged?

a)

A

b)

undefined

c)

error

d)

this

4.

Output?

a)

undefined

b)

John

c)

Error

d)

this.name

5.

Output?

a)

undefined

b)

Error

c)

Ana

d)

Nothing

6.

Output?

a)

5

b)

undefined

c)

Error

d)

null

7.

What is the output?

a)

50

b)

100

c)

undefined

d)

Error

8.

Output?

a)

window

b)

global object

c)

undefined

d)

Error

9.

Output?

a)

Leo

b)

undefined

c)

Error

d)

null

10.

Output?

a)

Zara

b)

undefined

c)

Error

d)

this.name

11.

Output?

a)

undefined

b)

NaN

c)

40

d)

20

12.

What is logged?

a)

20 then 10

b)

10 then 20

c)

undefined then undefined

d)

Error

13.

Output?

a)

1

b)

undefined

c)

Error

d)

null

14.

Output?

a)

undefined

b)

Error

c)

5

d)

NaN

15.

What is the output?

a)

10

b)

20

c)

undefined

d)

Error

16.

Output?

a)

10

b)

20

c)

undefined

d)

Error

17.

Output?

a)

A

b)

undefined

c)

Error

d)

Nothing

18.

Output?

a)

A

b)

undefined

c)

Error

d)

null

19.

What does this output?

a)

Sam Sam Sam

b)

undefined undefined undefined

c)

Error

d)

Sam undefined Sam

20.

Output?

a)

Global

b)

Local

c)

Inner

d)

undefined