menu

JavaScript Operators

JavaScript Operators - Important Points


6. Which operator is used for exponentiation in JavaScript?

A. ^

B. **

C. *

D. /

Discuss Work Space

Answer: option b

Explanation:

The ** operator is used for exponentiation in JavaScript.

7. What is the result of 2 ** 3 in JavaScript?

A. 6

B. 8

C. 9

D. 10

Discuss Work Space

Answer: option b

Explanation:

The ** operator is used for exponentiation. 2 raised to the power of 3 is 8.

8. What is the result of "5" + 2 in JavaScript?

A. 7

B. 7

C. 52

D. 52

Discuss Work Space

Answer: option d

Explanation:

When one of the operands of the + operator is a string, JavaScript treats the other operand as a string as well, and concatenates the two strings.

9. What is the result of "5" - 2 in JavaScript?

A. 3

B. 3

C. 52

D. 52

Discuss Work Space

Answer: option b

Explanation:

When the - operator is used, JavaScript tries to convert both operands to numbers. In this case, "5" is converted to 5, and the result of the subtraction is 3.

10. What is the result of 10 + "5" in JavaScript?

A. 105

B. 15

C. 15

D. 1005

Discuss Work Space

Answer: option a

Explanation:

When one of the operands of the + operator is a string, JavaScript treats the other operand as a string as well, and concatenates the two strings.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now