freeCodeCamp/curriculum/challenges/italian/02-javascript-algorithms-an.../basic-javascript/subtract-one-number-from-an...

60 lines
945 B
Markdown

---
id: cf1111c1c11feddfaeb4bdef
title: Sottrarre un numero da un altro con JavaScript
challengeType: 1
videoUrl: 'https://scrimba.com/c/cP3yQtk'
forumTopicId: 18314
dashedName: subtract-one-number-from-another-with-javascript
---
# --description--
Possiamo anche sottrarre un numero da un altro.
JavaScript utilizza il simbolo `-` per la sottrazione.
**Esempio**
```js
const myVar = 12 - 6;
```
`myVar` avrà il valore `6`.
# --instructions--
Modifica lo `0` in modo che la differenza sia `12`.
# --hints--
La variabile `difference` dovrebbe essere uguale a 12.
```js
assert(difference === 12);
```
Devi solo sottrarre un numero da 45.
```js
assert(/difference=45-33;?/.test(__helpers.removeWhiteSpace(code)));
```
# --seed--
## --after-user-code--
```js
(function(z){return 'difference = '+z;})(difference);
```
## --seed-contents--
```js
const difference = 45 - 0;
```
# --solutions--
```js
const difference = 45 - 33;
```