a) Prints an overflow error
b) Prints an exception error
c) Displays “Infinity”
d) Prints the value as such
2. The statement a===b refers to _________
a) Both a and b are equal in value and type
b) Both a and b are equal in value, type and reference address
c) Both a and b are equal in value
d) There is no such statement
Explanation: ”===” operator is known as the strict comparison operator. A strict comparison (===) is only true if the operands are of the same type and the contents match.
c) compilation error
d) runtime error
Explanation: A === operator is only true if the operands are of the same type and the contents match. Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions.
Explanation: The following code will generate into an error output as a comparator operator is used outside of if statement. A single equalto (’=’) operator is used for initialization.
5. The escape sequence ‘\f’ stands for _________
b) Floating numbers
c) Representation of functions that returns a value
d) Form feed
6. Which of the following Attribute is used to include External JS code inside your HTML Document?
7. The type of a variable that is volatile is _______________
a) Immutable variable
b) Mutable variable
c) Dynamic variable
d) Volatile variable
a) runtime error
b) compiler error
Explanation: != is the not equal to operator. It gives a value of 1 if the two values which are compared are not equal and give 0 if the two values are equal.
9. The snippet that has to be used to check if “a” is not equal to “null” is _________
c) if (!a)
Explanation: A strict comparison (e.g., ===) is only true if the operands are of the same type and the contents match. The more commonly-used abstract comparison (e.g. ==) converts the operands to the same type before making the comparison. The not-equal operator !== compares 0 to null and evaluates to either true or false.
a) runtime error
b) logical error
Explanation: A non string (integer) can be converted to string using .tostring() function. A strict comparison is only true if the operands are of the same type and the contents match. Hence the following code snippet would result into true output.