The multiplication operator

The multiplication operator behaves similarly to the division operator, apart from the obvious fact that it performs multiplication:

5 * 25; // => 125

It is necessary to watch out for effects of coercion and situations where either operand is NaN or Infinity. Rather intuitively, multiplying any non-zero finite value by Infinity will always result in Infinity (with the appropriate sign):

100 * Infinity; // => Infinity
-100 * Infinity; // => -Infinity

However, multiplying zero by Infinity will always result in NaN:

0 * Infinity; // => NaN
-Infinity * -0; // => NaN

Outside of these cases, most usages of the multiplication operator are fairly intuitive.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.98.208