JavaScript Operators
JavaScript Operators - Important Points
36. | What is the result of (true || false) in JavaScript? |
---|
A. 1
B. 0
C. null
D. undefined
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The || operator is the logical OR operator. It returns true if at least one of its operands is true, and false otherwise.
37. | What is the result of !(true || false) in JavaScript? |
---|
A. 1
B. 0
C. null
D. undefined
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The ! operator is the logical NOT operator. It returns the opposite of the operand's truthiness value. In this case, the operand is true || false, which evaluates to true, so the result of the ! operator is false.