The generalised syntax for a real number representation is………..
a) [digits][.digits][(E|e)[(+|-)]digits]
b) [digits][+digits][(E|e)[(+|-)]digits]
c) [digits][(E|e)[(+|-)]digits]
d) [.digits][digits][(E|e)[(+|-)]digits]
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.
JavaScript…….. when there is an indefinite or an infinite value during an arithmetic computation.
a) Prints an exception error
b) Prints an overflow error
c) Displays “Infinity”
d) Prints the value as such
Explanation: When the result of a numeric operation is larger than the largest representable number (overflow), JavaScript prints the value as Infinity. Similarly, when a negative value becomes larger than the largest representable negative number, the result is negative infinity. The infinite values behave as you would expect: adding, subtracting, multiplying, or dividing them by anything results in an infinite value (possibly with the sign reversed).
Which of the following is not considered as an error in JavaScript?
a) Syntax error
b) Missing of semicolons
c) Division by zero
d) Missing of Bracket
Explanation: Division by zero is not an error in JavaScript: it simply returns infinity or negative infinity. There is one exception, however: zero divided by zero does not have a well-defined value, and the result of this operation is the special not-a-number value, printed as NaN.
The escape sequence ‘\f’ stands for……….
a) Floating numbers
b) Representation of functions that returns a value
c) \f is not present in JavaScript
d) Form feed
Explanation: \f is the JavaScript escape sequence that stands for Form feed (\u000C). It skips to the start of the next page. (Applies mostly to terminals where the output device is a printer rather than a VDU).
The snippet that has to be used to check if “a” is not equal to “null” is…………
a) if(a!=null)
b) if (!a)
c) if(a!null)
d) if(a!==null)
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.
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 the strict comparison operator. A strict comparison (===) is only true if the operands are of the same type and the contents match.