What is the output of console.log(2 ** 3);?

What is the output of console.log(2 ** 3);?

a) 6
b) 8
c) 9
d) 4

Answer:

b) 8

Explanation:

The ** operator in JavaScript is used for exponentiation. The expression 2 ** 3 means “2 raised to the power of 3”, which equals 8.

Reference:

JavaScript MCQ (Multiple-Choice Questions)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top