JavaScript Operators
JavaScript Operators - Important Points
| 16. | What is the result of true && false in JavaScript? |
|---|
A. 1
B. 0
C. 1
D. 0
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The && operator is the logical AND operator. It returns true if both of its operands are true.
| 17. | What is the result of !true in JavaScript? |
|---|
A. 1
B. 0
C. 1
D. 0
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The ! operator is the logical NOT operator. It negates its operand, so !true is false.
| 18. | What is the result of typeof 42 in JavaScript? |
|---|
A. number
B. string
C. boolean
D. undefined
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The typeof 42 operator returns a number indicating the data type of its operand.
| 19. | What is the result of typeof "hello" in JavaScript? |
|---|
A. number
B. string
C. boolean
D. undefined
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The typeof operator returns a string indicating the data type of its operand.
| 20. | What is the result of typeof true in JavaScript? |
|---|
A. number
B. string
C. boolean
D. undefined
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The typeof true operator returns a boolean indicating the data type of its operand.