Q
What is the result of '10' - 2 in JavaScript?

Answer & Solution

Answer: Option A
Solution:
The result of '10' - 2 is 8 because the string is converted to a number for the subtraction.
Related Questions on Average

What is the result of 10 + '5' in JavaScript?

A). 105

B). 15

C). 10

D). 5

What is the result of Math.sqrt(16) in JavaScript?

A). 4

B). 8

C). 2

D). 16

What will be the value of x after let x = 10; x /= 2;?

A). 5

B). 2

C). 20

D). 10

What is the result of 10 - 6 in JavaScript?

A). 4

B). 6

C). 16

D). -4

What does Math.floor(5.9) return in JavaScript?

A). 5

B). 6

C). 7

D). 5

What is the result of Math.pow(2, 3) in JavaScript?

A). 8

B). 6

C). 9

D). 4

What will be the value of x after let x = 10; x *= 2;?

A). 20

B). 12

C). 8

D). 5

What is the result of 20 / 5 in JavaScript?

A). 4

B). 5

C). 25

D). 15

What is the result of 5 + 3 in JavaScript?

A). 8

B). 53

C). 35

D). 15

What does Math.round(5.7) return in JavaScript?

A). 6

B). 5

C). 7

D). 5