JavaScript operators are foundational symbols and keywords used to manipulate data, perform mathematical computations, assign values, and control programmatic flow within web applications. They range from standard arithmetic and assignment operators to sophisticated logical, bitwise, and comparison constructs. Modern ECMAScript specifications (ES6+) expanded this toolkit with features like the nullish coalescing operator (??), optional chaining (?.), and logical assignment operators (||=, &&=, ??=), which allow for concise, null-safe data handling. Understanding operator precedence, type coercion behaviors (such as loose versus strict equality), and short-circuit evaluation is critical for writing predictable code and excelling in technical interviews.
JavaScript Operators MCQs
1 min read
Correct Answer: a) Bitwise OR with zero (| 0)
Explanation:
Bitwise operators in JavaScript convert their operands to 32-bit signed integers, so using '| 0' truncates the decimal part of a number.
Correct Answer: a) -3
Explanation:
The double bitwise NOT (~~) truncates fractional digits toward zero, converting -3.7 to -3.
Correct Answer: a) null
Explanation:
Logical AND assignment (&&=) only assigns the right-hand value if the left-hand value is truthy. Since null is falsy, x remains null.
Correct Answer: a) Value
Explanation:
The nullish coalescing operator (??) skips both undefined and null (both are nullish) and returns the first defined value, which is "Value".
Correct Answer: a) false
Explanation:
The nullish coalescing operator (??) checks strictly for null or undefined. Since false is neither, it returns false.
Correct Answer: a) 2
Explanation:
Zero-fill right shift (>>>) shifts the binary digits of 10 (1010) right by 2 bits, yielding 2 (0010).
Correct Answer: a) 1073741821
Explanation:
Zero-fill right shift (>>>) fills from the left with zeroes, turning a negative 32-bit two's complement integer into a large positive integer.
Correct Answer: a) true
Explanation:
String comparisons are performed lexicographically using Unicode code point values; 'a' (97) is less than 'b' (98).
Correct Answer: a) true
Explanation:
Since both operands are strings, comparison occurs character-by-character; '1' comes before '9' in Unicode, making "10" < "9" true.
Correct Answer: a) false
Explanation:
When comparing a number and a string, JavaScript converts the string to a number ("9" becomes 9), making 10 < 9 false.
Correct Answer: a) 3345
Explanation:
Evaluated left to right: 1 + 2 = 3; 3 + "3" = "33"; "33" + 4 = "334"; "334" + 5 = "3345".
Correct Answer: a) 3
Explanation:
Unary plus converts +"" to 0, +"1" to 1, and +"2" to 2. Addition yields 0 + 1 + 2 = 3.
Correct Answer: a) Ternary operator (?:)
Explanation:
The ternary operator, assignment operators, unary operators, and exponentiation are right-to-left associative in JavaScript.
Correct Answer: a) NaN
Explanation:
Attempting division with a non-numeric string converts "a" to NaN, resulting in 10 / NaN, which is NaN.
Correct Answer: a) 1
Explanation:
According to ECMAScript standard for exponentiation, any base raised to the power of 0 (including NaN ** 0) returns 1.
Correct Answer: a) NaN
Explanation:
Raising 1 to the power of NaN evaluates to NaN according to the specification.
Correct Answer: a) function
Explanation:
The typeof operator returns "function" for arrow function expressions.
Correct Answer: a) 50
Explanation:
Assignment operators have lower precedence than arithmetic addition, so 2 + 3 is evaluated first (5), then x *= 5 (10 * 5 = 50).
Correct Answer: a) Removes element leaving an empty slot (undefined) at index 1 without changing array length
Explanation:
The delete operator removes array element properties, creating a sparse array with an empty/undefined slot, while preserving original array length.
Correct Answer: d) both a and c
Explanation:
In non-strict mode, deleting declared variables returns false. In strict mode, it throws a SyntaxError.
Correct Answer: a) true
Explanation:
The 'in' operator checks for index/property existence. Index 1 exists in the array, so it returns true.
Correct Answer: a) false
Explanation:
The 'in' operator checks for property key/index presence, not values. Index 20 does not exist in a 3-element array, returning false.
Correct Answer: a) true
Explanation:
Abstract equality (==) coerces boolean false to number 0, yielding 0 == 0 which is true.
Correct Answer: a) true
Explanation:
Abstract equality (==) coerces both false and empty string "" to number 0, returning true.
Correct Answer: a) true
Explanation:
Empty array [] converts to empty string "", which coerces to 0. False also coerces to 0, making 0 == 0 evaluate to true.
Correct Answer: a) false
Explanation:
Plain object {} converts to string "[object Object]", which coerces to NaN. False converts to 0. 0 == NaN evaluates to false.
Correct Answer: a) undefined
Explanation:
The expression `void 0` evaluates to primitive `undefined`, and passing `undefined` to `typeof` returns string "undefined".
Correct Answer: a) delete
Explanation:
The `delete` operator removes a specified property from an object.
Correct Answer: a) number
Explanation:
The comma operator evaluates operands and returns the last one (2). Then `typeof 2` returns "number".
Correct Answer: a) 3
Explanation:
Unary plus converts true to 1 and "2" to 2. Arithmetic addition evaluates 1 + 2 = 3.
Correct Answer: a) 81
Explanation:
Exponentiation is right-associative: 2 ** 2 = 4 first; then 3 ** 4 = 81.
Correct Answer: a) 81
Explanation:
Parentheses override standard precedence: (3 ** 2) = 9; then 9 ** 2 = 81.
Correct Answer: a) 0
Explanation:
Bitwise NOT (~) formula is `-(x + 1)`. For x = -1: `-(-1 + 1) = -0`, which displays as integer 0.
Correct Answer: a) -1
Explanation:
Bitwise NOT (~) formula is `-(x + 1)`. For x = 0: `-(0 + 1) = -1`.
Correct Answer: d) Boolean(0)
Explanation:
0 is a falsy primitive value. Object instances (`new Boolean(false)`), non-empty strings, and arrays are all truthy.
Correct Answer: a) false
Explanation:
Boolean true coerces to number 1. The comparison becomes 10 == 1, which evaluates to false.
Correct Answer: a) true
Explanation:
Boolean true coerces to number 1. Comparison 1 == 1 evaluates to true.
Correct Answer: a) foo
Explanation:
Logical OR (||) short-circuits and returns the first truthy operand, which is "foo".
Correct Answer: a) bar
Explanation:
Logical AND (&&) evaluates the second operand if the first is truthy, returning "bar".
Correct Answer: a) bar
Explanation:
Logical OR (||) encounters falsy `null` on the left, proceeding to return the right operand "bar".
Correct Answer: a) null
Explanation:
Logical AND (&&) encounters falsy `null` on the left and short-circuits, returning `null` immediately.
Correct Answer: a) "[object Object]"
Explanation:
Empty array converts to empty string ""; object converts to string "[object Object]". Concatenation produces "[object Object]".
Correct Answer: a) "[object Object]"
Explanation:
When evaluated as an expression argument inside console.log(), {} converts to "[object Object]" and [] to "", concatenating to "[object Object]".
Correct Answer: a) 1
Explanation:
The left operand 1 is defined (not null or undefined), so nullish coalescing operator returns 1.
Correct Answer: a) 100
Explanation:
Variable `a` is uninitialized (undefined). Nullish assignment (`??=`) assigns 100 to `a`.
Correct Answer: a) 5
Explanation:
Variable `a` is set to 5 (not nullish). Nullish assignment (`??=`) skips assignment and leaves `a` as 5.
Correct Answer: a) Yield operator (yield)
Explanation:
The yield operator in generator functions has precedence level 2, which is lower than conditional (3), logical OR (4), or equality (9).
Correct Answer: a) number
Explanation:
NaN is a special numeric value defined by the IEEE 754 standard, so `typeof NaN` returns "number".
Correct Answer: a) object
Explanation:
typeof null returning "object" is a historical bug in JS preserved for backwards compatibility.
Correct Answer: a) undefined
Explanation:
The type of primitive value undefined is string "undefined".
Correct Answer: a) 5
Explanation:
Subtraction operator coerces string "10" into number 10, computing 10 - 5 = 5.
Correct Answer: a) 105
Explanation:
Binary addition operator with a string performs string concatenation, resulting in "105".
Correct Answer: a) false
Explanation:
0 is a falsy value. Double negation (!!) coerces 0 into boolean false.
Correct Answer: a) true
Explanation:
1 is a truthy value. Double negation (!!) coerces 1 into boolean true.
Correct Answer: a) false
Explanation:
Empty string "" is a falsy value. Double negation (!!) evaluates to boolean false.
Correct Answer: a) true
Explanation:
An empty plain object {} is a truthy value, so double negation (!!) returns boolean true.
Correct Answer: a) true
Explanation:
An empty array [] is a truthy value in JavaScript, so double negation (!!) yields boolean true.
Correct Answer: a) 1
Explanation:
In JavaScript remainder operator (%), the sign of the result matches the sign of the dividend (left operand). Positive 10 produces positive 1.
Correct Answer: a) -1
Explanation:
The sign of the remainder matches the dividend (left operand). Negative -10 produces negative remainder -1.
Correct Answer: a) -1
Explanation:
The sign of the remainder depends strictly on the dividend (-10), yielding -1 regardless of the divisor's sign.
Correct Answer: a) string
Explanation:
1 step: `typeof 1` = "number". 2 step: `typeof "number"` = "string". 3 step: `typeof "string"` = "string".
Correct Answer: a) true
Explanation:
Evaluated left to right: (1 < 2) is true. Then (true < 3) coerces true to 1, evaluating (1 < 3) which is true.
Correct Answer: a) false
Explanation:
Evaluated left to right: (3 > 2) is true. Then (true > 1) coerces true to 1, evaluating (1 > 1) which is false.
Correct Answer: a) &&
Explanation:
The logical AND operator (&&) checks if both expressions evaluate to truthy values.
Correct Answer: a) ||
Explanation:
The logical OR operator (||) checks if at least one expression evaluates to a truthy value.
Correct Answer: a) true
Explanation:
Abstract equality (==) coerces string "5.0" to number 5, making 5 == 5 evaluate to true.
Correct Answer: a) false
Explanation:
Strict equality operator (===) compares data types without coercion, returning false since number and string differ.
Correct Answer: a) NaN
Explanation:
Subtracting Infinity from Infinity is an indeterminate mathematical form, returning NaN.
Correct Answer: a) NaN
Explanation:
Dividing Infinity by Infinity is mathematically undefined, returning NaN.
Correct Answer: a) NaN
Explanation:
Multiplying zero by Infinity is an indeterminate operation, returning NaN.
Correct Answer: a) 1 4
Explanation:
The first ternary evaluates true (1). The second ternary evaluates false (4). Outputs 1 4.
Correct Answer: a) Creates a empty instance object, binds `this`, connects prototype, and returns the object
Explanation:
The `new` operator instantiates an object from a constructor function, setting up prototype linkage and internal `this` context.
Correct Answer: a) true
Explanation:
Character 'b' has a higher ASCII/Unicode code point (98) than 'a' (97), evaluating to true.
Correct Answer: a) false
Explanation:
Uppercase ASCII letters ('A' = 65) have smaller code points than lowercase letters ('a' = 97), making 'A' > 'a' false.
Correct Answer: a) 2 1
Explanation:
Postfix increment (`a++`) returns current value (1) to `b`, then increments `a` to 2.
Correct Answer: a) 2 2
Explanation:
Prefix increment (`++a`) increments `a` to 2 first, then assigns the new value (2) to `b`.
Correct Answer: a) true
Explanation:
Abstract equality operator coerces string "10" to number 10, producing true.
Correct Answer: a) false
Explanation:
Strict equality checks value and type. Number 10 does not strictly match string "10".
Correct Answer: a) object
Explanation:
In JavaScript, arrays are objects. The `typeof` operator returns "object" for array references.
Correct Answer: a) object
Explanation:
The `typeof` operator returns string "object" for plain JavaScript object literals.
Correct Answer: a) 11
Explanation:
Addition converts boolean `true` to number 1, computing 10 + 1 = 11.
Correct Answer: a) 10
Explanation:
Addition converts boolean `false` to number 0, computing 10 + 0 = 10.
Correct Answer: a) 10
Explanation:
Numeric addition coerces `null` to number 0, yielding 10 + 0 = 10.
Correct Answer: a) NaN
Explanation:
Numeric addition coerces `undefined` to `NaN`, resulting in 10 + NaN = NaN.
Correct Answer: a) 9
Explanation:
Subtraction operator forces numeric conversion on both operands: "10" becomes 10, true becomes 1. 10 - 1 = 9.
Correct Answer: a) 10
Explanation:
Subtraction coerces "10" to 10 and false to 0, evaluating 10 - 0 = 10.
Correct Answer: a) 10
Explanation:
Subtraction coerces "10" to 10 and null to 0, evaluating 10 - 0 = 10.
Correct Answer: a) NaN
Explanation:
Subtraction coerces undefined to NaN, yielding 10 - NaN = NaN.
Correct Answer: a) ||=
Explanation:
The logical OR assignment operator (`||=`) assigns the right operand to the left variable if the variable evaluates to falsy.
Correct Answer: a) &&=
Explanation:
The logical AND assignment operator (`&&=`) assigns the right operand to the left variable if the variable evaluates to truthy.
Correct Answer: a) ??=
Explanation:
The logical nullish assignment operator (`??=`) assigns the right operand to the left variable if the variable is nullish.
Correct Answer: a) Yes
Explanation:
Since the condition is boolean true, the ternary expression returns the first expression option ("Yes").
Correct Answer: a) No
Explanation:
Since the condition is boolean false, the ternary expression returns the second expression option ("No").
Correct Answer: a) 0
Explanation:
The unary plus (+) operator explicitly converts boolean false to number 0.
Correct Answer: a) 1
Explanation:
The unary plus (+) operator explicitly converts boolean true to number 1.
Correct Answer: a) 0
Explanation:
The unary plus (+) operator explicitly converts null to number 0.
Correct Answer: a) NaN
Explanation:
The unary plus (+) operator attempts numeric conversion on undefined, which yields NaN.
Correct Answer: a) 5
Explanation:
Division operator coerces string "10" into number 10, computing 10 / 2 = 5.
Correct Answer: a) 20
Explanation:
Multiplication operator coerces string "10" into number 10, computing 10 * 2 = 20.
Correct Answer: a) 1
Explanation:
Remainder operator coerces string "10" into number 10, computing 10 % 3 = 1.
Correct Answer: a) string
Explanation:
1 + "1" results in string concatenation ("11"). `typeof "11"` returns string "string".
Correct Answer: a) number
Explanation:
1 - "1" results in numeric subtraction (0). `typeof 0` returns string "number".
Related Posts

Java Collections Frame Work MCQs
The Java Collections Framework provides a unified architecture consisting of interfaces (such as List, Set, and Map) and implementation classes…
October 19, 2026By MCQs Generator

C++ Arrays / Lists - MCQs
Sequential data structures in C++ allow developers to store and manipulate contiguous collections of elements in memory. C++ provides multiple…
October 20, 2026By MCQs Generator

C++ Control Flow / If-Else MCQs Conditional Statements
Control flow statements determine the execution path of a program based on runtime conditions. In C++, decision-making relies primarily on…
October 20, 2026By MCQs Generator
Related Categories

AI & Data Science MCQ
5 topics
By MCQs Generator

Arts & Humanities MCQ
4 topics
By MCQs Generator

Civil Engineering MCQ
4 topics
By MCQs Generator

Commerce & Business MCQ
4 topics
By MCQs Generator

Competitive Exams MCQ
5 topics
By MCQs Generator

Electrical & Electronics Engineering MCQ
3 topics
By MCQs Generator

General Knowledge MCQ
2 topics
By MCQs Generator

General Science MCQ
4 topics
By MCQs Generator

Law & Judiciary MCQ
3 topics
By MCQs Generator

Mechanical Engineering MCQ
4 topics
By MCQs Generator

Medical & Health Sciences MCQ
4 topics
By MCQs Generator

Modern Tech Fields MCQ
3 topics
By MCQs Generator