Files
freeCodeCamp/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/basic-javascript/divide-one-number-by-another-with-javascript.md
2022-08-19 20:53:29 +02:00

60 lines
910 B
Markdown

---
id: cf1111c1c11feddfaeb6bdef
title: Dividieren einer Zahl durch eine andere mit JavaScript
challengeType: 1
videoUrl: 'https://scrimba.com/c/cqkbdAr'
forumTopicId: 17566
dashedName: divide-one-number-by-another-with-javascript
---
# --description--
Wir können auch eine Zahl durch eine andere dividieren.
JavaScript verwendet das Symbol `/` für die Division.
**Beispiel**
```js
const myVar = 16 / 2;
```
`myVar` hat jetzt den Wert `8`.
# --instructions--
Ändere die `0` so, dass der `quotient` gleich `2` ist.
# --hints--
Die Variable `quotient` sollte 2 sein.
```js
assert(quotient === 2);
```
Du solltest den Operator `/` verwenden.
```js
assert(/\d+\s*\/\s*\d+/.test(code));
```
# --seed--
## --after-user-code--
```js
(function(z){return 'quotient = '+z;})(quotient);
```
## --seed-contents--
```js
const quotient = 66 / 0;
```
# --solutions--
```js
const quotient = 66 / 33;
```