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
.