b) Triggering Event
2. The type of a variable that is volatile is _______________
a) Volatile variable
b) Mutable variable
c) Immutable variable
d) Dynamic variable
3. A hexadecimal literal begins with __________
d) Both 0x and 0X
Explanation: Generally, X or x denotes hexadecimal values. So, any integer literal that begins with 0X or 0x denotes a hexadecimal number.
4. The generalised syntax for a real number representation is __________
Explanation: Floating-point literals may also be represented using exponential notation: a real number followed by the letter e (or E), followed by an optional plus or minus sign, followed by an integer exponent. This notation represents the real number multiplied by 10 to the power of the exponent.
a) Prints an exception error
b) Prints an overflow error
c) Displays “Infinity”
d) Prints the value as such
a) Syntax error
b) Missing of semicolons
c) Division by zero
d) Missing of Bracket
7. The escape sequence ‘\f’ stands for _________
a) Floating numbers
b) Representation of functions that returns a value
d) Form feed
8. The snippet that has to be used to check if “a” is not equal to “null” is _________
b) 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.
9. The statement a===b refers to _________
a) Both a and b are equal in value, type and reference address
b) Both a and b are equal in value
c) Both a and b are equal in value and type
d) There is no such statement
Explanation: :”===” operator is known as strict comparison operator. A strict comparison (===) is only true if the operands are of the same type and the contents match.
10. Assume that we have to convert “false” that is a non-string to string. The command that we use is (without invoking the “new” operator)
c) String newvariable=”false”
d) Both false.toString() and String(false)
Explanation: The three approaches for converting to string are: value.toString(),”” + value and String(value). A non-string can be converted in two ways without using a new operator false.toString () and String(false).