Javascript Expression And Operator MCQ
This section focuses on the "Javascript Expression And Operator" of the Javascript (JS). These Multiple Choice Questions (mcq) should be practiced to improve the Javascript skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. Which operator is known as the equality operator, which checks whether its two operators are "equal"?
A. =
B. ==
C. ===
D. &&
View Answer
Ans : B
Explanation: == operator is known as the equality operator, it checks whether its two operators are equal or not.
2. Which operator is known as the strict equality operator, which checks whether its two operators are identical or not?
A. =
B. ==
C. ===
D. &&
View Answer
Ans : C
Explanation: === operator is known as the strict equality operator, itchecks whether its two operators are identical or not.
3. Which operator will return false if two value are equal?
A. !
B. !=
C. !==
D. All of the above
View Answer
Ans : B
Explanation: != operator will return false if two value are equal.
4. When using comparative operators,if after object to primitive conversion, at least one operand is not a string, both operands are converted to?
A. String
B. Boolean
C. Number
D. Object
View Answer
Ans : C
Explanation: ,if after object to primitive conversion, at least one operand is not a string, both operands are converted to Number.
5. If the operator value is null, then the unary operator returns the typeof _________.
A. undefined
B. object
C. boolean
D. string
View Answer
Ans : B
Explanation: If the operator value is null, then the unary operator returns the typeof object.
6. which operator evaluates its operands, then discards the value and returns undefined?
A. In
B. Comparison
C. Eval
D. Void
View Answer
Ans : D
Explanation: Void is the operatorwhich evaluates its operands, then discards the value and returns undefined.
7. If var A={B:3, C:5}, how to use the delete operator to delete one of the properties of an object.
A. delete
B. delete A
C. delete A.B
D. delete A[0]
View Answer
Ans : C
Explanation: delete A.B to delete one of the properties of an object A.
8. What will be the output if we compare "ten" and 10 with less then comparison operator("ten"<10)?
A. True
B. False
C. undefined
D. error
View Answer
Ans : B
Explanation: It will return False when we compare "ten" and 10 with less then comparison operator.
9. If an operator is NaN or converts to NaN, what wil comparison operator always returns ?
A. True
B. False
C. Undefined
D. NAN
View Answer
Ans : B
Explanation: If an operator is NaN or converts to NaN, the comparison operator always returns False.
10. State whether the following statements are True or False for strict equality operator(= = =).
i) If the two values have different types they are equal.
ii) If both values are null or both values are undefined, they are equal.
A. True True
B. False False
C. True False
D. False True
View Answer
Ans : D
Explanation: The first statement is False While second statement is True.
11. which operator outputs the remainder of an integer division?
A. Add
B. Subtraction
C. Modulus
D. Increment
View Answer
Ans : C
Explanation: % (Modulus) : Outputs the remainder of an integer division
12. Which operator checks if the value of the left operand is greater than the value of the right operand?
A. Equal
B. Greater than
C. Less than
D. Greater than or Equal to
View Answer
Ans : B
Explanation: Greater than : Checks if the value of the left operand is greater than the value of the right operand, if yes, then the condition becomes true.
13. Logical AND : If both the operands are non-zero, then the condition becomes true.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Logical AND If both the operands are non-zero, then the condition becomes true.
14. Which of the following statement is true about BitWise OR?
A. It performs a Boolean AND operation on each bit of its integer arguments
B. It is a unary operator and operates by reversing all the bits in the operand.
C. Both A and B
D. It performs a Boolean OR operation on each bit of its integer arguments.
View Answer
Ans : D
Explanation: BitWise OR : It performs a Boolean OR operation on each bit of its integer arguments.
15. A __________ will be visible only within a function where it is defined.
A. global variables
B. local variable
C. Both A and B
D. None of the above
View Answer
Ans : B
Explanation: Local Variables : A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.
Also check :
Discussion