JavaScript Operators
JavaScript Operators - Important Points
31. | What is the result of ++i when i is 3 in JavaScript? |
---|
A. 2
B. 3
C. 4
D. undefined
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The ++ operator is the increment operator. It adds 1 to its operand and returns the new value.
32. | What is the result of i++ when i is 3 in JavaScript? |
---|
A. 2
B. 3
C. 4
D. undefined
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The ++ operator is the increment operator. It adds 1 to its operand and returns the old value.
33. | What is the result of --i when i is 3 in JavaScript? |
---|
A. 2
B. 3
C. 4
D. undefined
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The -- operator is the decrement operator. It subtracts 1 from its operand and returns the new value.
34. | What is the result of i-- when i is 3 in JavaScript? |
---|
A. 2
B. 3
C. 4
D. undefined
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The -- operator is the decrement operator. It subtracts 1 from its operand and returns the old value.
35. | 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 AND operator. It returns true if both of its operands are true, and false otherwise.