Files
freeCodeCamp/curriculum/challenges/italian/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-multiplication.md
camperbot b3af21d50f chore(i18n,curriculum): update translations (#42487)
* chore(i18n,curriculum): update translations

* chore: Italian to italian

Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
2021-06-14 11:34:20 -07:00

1.4 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
56533eb9ac21ba0edf2244b1 Assegnazione composta con moltiplicazione aumentata 1 https://scrimba.com/c/c83vrfa 16662 compound-assignment-with-augmented-multiplication

--description--

L'operatore *= moltiplica una variabile per un numero.

myVar = myVar * 5;

moltiplicherà myVar per 5. Questo può essere riscritto come:

myVar *= 5;

--instructions--

Converti le assegnazioni per a, b e c in modo da utilizzare l'operatore *=.

--hints--

a dovrebbe essere uguale a 25.

assert(a === 25);

b dovrebbe essere uguale a 36.

assert(b === 36);

c dovrebbe essere uguale a 46.

assert(c === 46);

Dovresti usare l'operatore *= per ogni variabile.

assert(code.match(/\*=/g).length === 3);

Non dovresti modificare il codice sopra il commento specificato.

assert(
  /var a = 5;/.test(code) &&
    /var b = 12;/.test(code) &&
    /var c = 4\.6;/.test(code)
);

--seed--

--after-user-code--

(function(a,b,c){ return "a = " + a + ", b = " + b + ", c = " + c; })(a,b,c);

--seed-contents--

var a = 5;
var b = 12;
var c = 4.6;

// Only change code below this line
a = a * 5;
b = 3 * b;
c = c * 10;

--solutions--

var a = 5;
var b = 12;
var c = 4.6;

a *= 5;
b *= 3;
c *= 10;