60 lines
1.1 KiB
Markdown
60 lines
1.1 KiB
Markdown
---
|
||
id: bd7993c9c69feddfaeb7bdef
|
||
title: Multiply Two Decimals with JavaScript
|
||
challengeType: 1
|
||
videoUrl: ''
|
||
localeTitle: 使用JavaScript乘以两个小数
|
||
---
|
||
|
||
## Description
|
||
<section id="description">在JavaScript中,您也可以使用十进制数执行计算,就像整数一样。让我们将两位小数相乘得到它们的乘积。 </section>
|
||
|
||
## Instructions
|
||
<section id="instructions">更改<code>0.0</code>使产品等于<code>5.0</code> 。 </section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: 变量<code>product</code>应该等于<code>5.0</code> 。
|
||
testString: 'assert(product === 5.0, "The variable <code>product</code> should equal <code>5.0</code>.");'
|
||
- text: 你应该使用<code>*</code>运算符
|
||
testString: 'assert(/\*/.test(code), "You should use the <code>*</code> operator");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
var product = 2.0 * 0.0;
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
### After Test
|
||
<div id='js-teardown'>
|
||
|
||
```js
|
||
console.info('after the test');
|
||
```
|
||
|
||
</div>
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|