freeCodeCamp/curriculum/challenges/chinese/02-javascript-algorithms-an.../basic-javascript/multiply-two-numbers-with-j...

61 lines
821 B
Markdown
Raw Normal View History

---
id: cf1231c1c11feddfaeb5bdef
title: 乘法运算
challengeType: 1
videoUrl: 'https://scrimba.com/c/cP3y3Aq'
forumTopicId: 18243
dashedName: multiply-two-numbers-with-javascript
---
# --description--
我们也可在 JavaScript 中使用乘法运算。
JavaScript 使用 `*` 符号表示两数相乘。
**示例**
```js
myVar = 13 * 13;
```
现在,变量 `myVar` 的值为 `169`
# --instructions--
改变数值 `0`来让变量 product 的值等于`80`。
# --hints--
变量 `product` 的值应该等于 80。
```js
assert(product === 80);
```
使用 `*` 运算符。
```js
assert(/\*/.test(code));
```
# --seed--
## --after-user-code--
```js
(function(z){return 'product = '+z;})(product);
```
## --seed-contents--
```js
var product = 8 * 0;
```
# --solutions--
```js
var product = 8 * 10;
```