menu

JavaScript Operators

JavaScript Operators - Important Points


26. What is the result of 2 != "2" in JavaScript?

A. 1

B. 0

C. null

D. undefined

Discuss Work Space

Answer: option b

Explanation:

The != operator is the inequality operator. It returns true if its operands are not equal, after converting them to a common data type if necessary.

27. What is the result of 2 !== "2" in JavaScript?

A. 1

B. 0

C. null

D. undefined

Discuss Work Space

Answer: option a

Explanation:

The !== operator is the strict inequality operator. It returns true if its operands are of different types, or if they are of the same type but have different values.

28. What is the result of "hello" + "world" in JavaScript?

A. hello world

B. helloworld

C. hello + world

D. worldhello

Discuss Work Space

Answer: option b

Explanation:

The + operator is the concatenation operator when used with strings. It concatenates its operands to form a new string.

29. What is the result of "3" / 2 in JavaScript?

A. 1.5

B. 2

C. 3

D. NaN

Discuss Work Space

Answer: option a

Explanation:

The / operator is the division operator when used with numbers. When one of the operands is a string, JavaScript attempts to convert it to a number before performing the operation.

30. What is the result of 5 % 2 in JavaScript?

A. 1

B. 2

C. 3

D. 0

Discuss Work Space

Answer: option a

Explanation:

The % operator is the remainder operator. It returns the remainder of dividing its left operand by its right operand.


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