wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript 2

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

What will be the output?

console.log(1 == '1');

a)

true

b)

false

2.

What will be the output?

console.log(1 === '1');

a)

true

b)

false

3.

What will be the output?

console.log(1 == '01');

a)

true

b)

false

4.

What will be the output?

console.log(10 > '9');

a)

true

b)

false

5.

What will be the output?

console.log('8' + 7);

a)

15

b)

87

c)

some error

6.

What will be the output?

console.log(8 + '7');

a)

15

b)

87

c)

some error

7.

What will be the output?

console.log(10 / 0);

a)

some error

b)

Infinity

c)

0

8.

What will be the output?

console.log(10 / Infinity);

a)

some error

b)

0

c)

Infinity

d)

NaN

9.

What will be the output?

console.log(Infinity / Infinity);

a)

some error

b)

0

c)

NaN

d)

Infinity

10.

What will be the output?

console.log(0 == false);

a)

true

b)

false

11.

What will be the output?

console.log('' == false); //there is an empty string on the statement

a)

true

b)

false

12.

What will be the output?

console.log('' == 0); //there is an empty string on the statement

a)

true

b)

false

13.

What will be the output?

console.log(undefined == null);

a)

true

b)

false

14.

What will be the output?

console.log(NaN == NaN);

a)

true

b)

false

15.

What will be the output?

let number = 0;

console.log(number++);

console.log(++number);

console.log(number);

a)

1

2

2

b)

0

2

2

c)

0

1

2

16.

What will be the output?

const obj = { a: 'one', b: 'two', a: 'three' };

console.log(obj);

a)

some error

b)

{ a: 'three', b: 'two'}

c)

{ a: 'one', b: 'two', a: 'three' }

17.

Select the falsy values!

(more than one correct answer is possible)

a)

''

b)

'1'

c)

0

d)

null

e)

true