Basic And Variables - Study Mode

[#36] The generalised syntax for a real number representation is
Correct Answer

(A) [digits][.digits][(E|e)[(+|-)]digits]

Explanation

Solution: 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.

[#37] When there is an indefinite or an infinity value during an arithmetic value computation, javascript
Correct Answer

(C) Displays “Infinity”

Explanation

Solution: When the result of a numeric operation is larger than the largest representable number (overflow), the result is a special infinity value, which JavaScript prints as Infinity. Similarly, when a negative value becomes larger than the largest representable negative number, the result is negative infinity, printed as -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.

[#38] Which of the following is not considered as an error in JavaScript?
Correct Answer

(C) Division by zero

Explanation

Solution: 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 welldefined value, and the result of this operation is the special not-a-number value, printed as NaN.

[#39] The escape sequence ‘f’ stands for
Correct Answer

(D) Form feed

Explanation

Solution: f is the JavaScript escape sequence that stands for Form feed (u000C).

[#40] The snippet that has to be used to check if “a” is not equal to “null” is
Correct Answer

(D) if(a!==null)

Explanation

Solution: The not-equal operator !== compares o to null and evaluates to either true or false.