1.

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 BracketThis question was posed to me during an online interview.The query is from Types, Values and Variables in portion Lexical Structures of JavaScript

Answer»

Right option is (C) Division by zero

Easiest 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.



Discussion

No Comment Found

Related InterviewSolutions