[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Multiplication [Back]  [Original]

* - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

*

20157

*

console.log(3 * 4);
// Expected output: 12

console.log(-3 * 4);
// Expected output: -12

console.log("3" * 2);
// Expected output: 6

console.log("foo" * 2);
// Expected output: NaN

js
x * y

js
2 * 2; // 4
-2 * 2; // -4

Infinity

js
Infinity * 0; // NaN
Infinity * Infinity; // Infinity

js
"foo" * 2; // NaN

ECMAScript 2027 LanguageSpecification
# sec-multiplicative-operators


Web Proxy Viewer  |  New URL  |  Original Page