Explanation:
In JavaScript, dividing a number by zero does not throw an error. Instead, it returns Infinity (or -Infinity for negative numbers). JavaScript handles division by zero gracefully, unlike some other languages where it may cause an error.
Example:
console.log(10 / 0); // Output: Infinity
console.log(-10 / 0); // Output: -Infinity
However, if the value is 0/0, it results in NaN (Not-a-Number):
console.log(0 / 0); // Output: NaN
Why Not Other Options?
- (A) Missing of Bracket β β Error (Missing brackets can cause syntax errors).
- (B) Syntax error β β Error (Incorrect syntax results in a SyntaxError).
- (C) Missing of semicolons β β Error (Although JavaScript has automatic semicolon insertion, in some cases, missing semicolons can lead to unexpected behavior or errors).
Final Answer:
β (D) Division by zero (It returns Infinity instead of throwing an error).