Q
What is the value of the expression '20' - 10 in JavaScript?

Answer & Solution

Answer: Option A
Solution:
In JavaScript, when a string that represents a number is used with the - operator, it is converted to a number and the subtraction is performed. Therefore, the value of the expression '20' - 10 is 10. Option A is correct for the value of the expression.
Related Questions on Average

What data type does the value true represent in JavaScript?

A). Number

B). String

C). Boolean

D). Object

Which of the following represents an array in JavaScript?

A). {name: 'John', age: 30}

B). 'Hello'

C). [1, 2, 3]

D). 1

Which of the following represents an undefined value in JavaScript?

A). 'undefined'

B). null

C). undefined

D). 'null'

What is the value of the expression true && false in JavaScript?

A). 1

B). 0

C). Error

D). null

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

A). 105

B). '15'

C). 15

D). '105'

What is the value of the expression !(5 > 3) in JavaScript?

A). 1

B). 0

C). Error

D). null

Which of the following represents a string value in JavaScript?

A). {name: 'John', age: 30}

B). 42

C). 'Hello, World!'

D). 1

What is the value of the expression (true

A).

B). false) && (true && false) in JavaScript?

C). 1

D). 0

What is the value of the expression 5 + 5 + '10' in JavaScript?

A). 20

B). '510'

C). '15'

D). 15

Which of the following represents a null value in JavaScript?

A). undefined

B). 'null'

C). null

D). 0