mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-20 10:38:17 -05:00
51 lines
867 B
Markdown
51 lines
867 B
Markdown
---
|
|
id: bd7993c9ca9feddfaeb7bdef
|
|
title: Dividieren einer Dezimalzahl durch eine andere mit JavaScript
|
|
challengeType: 1
|
|
videoUrl: 'https://scrimba.com/c/cBZe9AW'
|
|
forumTopicId: 18255
|
|
dashedName: divide-one-decimal-by-another-with-javascript
|
|
---
|
|
|
|
# --description--
|
|
|
|
Dividieren wir nun eine Dezimalzahl durch eine andere.
|
|
|
|
# --instructions--
|
|
|
|
Ändere `0.0`, so dass `quotient` gleich `2.2` wird.
|
|
|
|
# --hints--
|
|
|
|
Die Variable `quotient` sollte gleich `2.2` sein.
|
|
|
|
```js
|
|
assert(quotient === 2.2);
|
|
```
|
|
|
|
Verwende den Operator `/`, um 4,4 durch 2 zu teilen.
|
|
|
|
```js
|
|
assert(/4\.40*\s*\/\s*2\.*0*/.test(code));
|
|
```
|
|
|
|
Die Quotientenvariable sollte nur einmal zugewiesen werden
|
|
|
|
```js
|
|
assert(code.match(/quotient/g).length === 1);
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```js
|
|
const quotient = 0.0 / 2.0; // Change this line
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```js
|
|
const quotient = 4.4 / 2.0;
|
|
```
|