1.6K
Wonderful JavaScript MCQs Series for Beginner .Practice these MCQs to enhance and test the knowledge of JavaScript. This JavaScript Quiz is based on Operators.
1. Which of the following statement is true about BitWise OR?
- It performs a Boolean AND operation on each bit of its integer arguments
- It is a unary operator and operates by reversing all the bits in the operand.
- Both A and B
- It performs a Boolean OR operation on each bit of its integer arguments.
4) It performs a Boolean OR operation on each bit of its integer arguments.
2.Which one of the following options are not valid in JavaScript?
- “My name is “Harry” “
- “My name is Harry”
- My name is Harry’
- “My name is ‘Harry’ “
1)”My name is “Harry” “
3.What is the output for code A and B?
Code A:
var x = 10;
y = --x + 1;
alert(y);
Code B:
var x = 10;
y = x-- + 1;
alert(y);
- 10,11
- 11,11
- 11,10
- 10,10
1)10,11
4. Which operator is known as the equality operator, which checks whether its two operators are “equal”?
- =
- ==
- ===
- &&
2)==
5.isNan function returns ______ if the argument is not a number; otherwise it is ______.
- True, True
- False, False
- True, False
- False, True
3)True, False
6. Which operator is known as the strict equality operator, which checks whether its two operators are identical or not?
- =
- ==
- ===
- &&
3)===
7.What is the value of C here?
var a = 100; var b = "10"; var c = a + b;
- 10010
- 10100
- 110
- None
1)10010
8. Which operator will return false if two value are equal?
- !
- !=
- !==
- All of the above
View Answer
2)!=
9.Which operator checks if the value of the left operand is greater than the value of the right operand?
- Equal
- Greater than
- Less than
- Greater than or Equal to
2)Greater than
10.Multiple variables can be created and initialized in a single JavaScript statement.
- True
- False
1)True
11.Which statement will return the value false?
- var result = 30 >= 30;
- var result = (20 === “20”) && (50 < 30);
- var result = 20 < 50;
2)var result = (20 === “20”) && (50 < 30);
12. Logical AND : If both the operands are non-zero, then the condition becomes true.
- Yes
- No
- Can be yes or no
- Can not say
1)Yes
13. A __________ will be visible only within a function where it is defined.
- global variables
- local variable
- Both A and B
- None of the above
2)local variable
14. What will be the output if we compare “ten” and 10 with less then comparison operator(“ten”<10)?
- True
- False
- undefined
- error
2)False
15. If an operator is NaN or converts to NaN, what wil comparison operator always returns ?
- True
- False
- Undefined
- NAN
2)False