* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
59 lines
800 B
Markdown
59 lines
800 B
Markdown
---
|
|
id: cf1111c1c11feddfaeb6bdef
|
|
title: 除法运算
|
|
challengeType: 1
|
|
videoUrl: 'https://scrimba.com/c/cqkbdAr'
|
|
forumTopicId: 17566
|
|
dashedName: divide-one-number-by-another-with-javascript
|
|
---
|
|
|
|
# --description--
|
|
|
|
我们可以在 JavaScript 中做除法运算。
|
|
|
|
JavaScript 中使用`/`符号做除法运算。
|
|
|
|
**示例**
|
|
|
|
```js
|
|
myVar = 16 / 2; // assigned 8
|
|
```
|
|
|
|
# --instructions--
|
|
|
|
改变数值`0`来让变量`quotient`的值等于`2`。
|
|
|
|
# --hints--
|
|
|
|
要使`quotient`的值等于 2。
|
|
|
|
```js
|
|
assert(quotient === 2);
|
|
```
|
|
|
|
使用`/`运算符。
|
|
|
|
```js
|
|
assert(/\d+\s*\/\s*\d+/.test(code));
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --after-user-code--
|
|
|
|
```js
|
|
(function(z){return 'quotient = '+z;})(quotient);
|
|
```
|
|
|
|
## --seed-contents--
|
|
|
|
```js
|
|
var quotient = 66 / 0;
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```js
|
|
var quotient = 66 / 33;
|
|
```
|