Files
freeCodeCamp/curriculum/challenges/german/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-division.md
2022-08-19 20:53:29 +02:00

1.3 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
56533eb9ac21ba0edf2244b2 Kombination von Zuordnung und Division 1 https://scrimba.com/c/c2QvKT2 16659 compound-assignment-with-augmented-division

--description--

Der Operator /= teilt eine Variable durch eine andere Zahl.

myVar = myVar / 5;

Teilt myVar durch 5. Dies kann wie folgt umgeschrieben werden:

myVar /= 5;

--instructions--

Ändere die Zuweisungen für a, b und c so, dass sie den Operator /= verwenden.

--hints--

a sollte gleich 4 sein.

assert(a === 4);

b sollte gleich 27 sein.

assert(b === 27);

c sollte gleich 3 sein.

assert(c === 3);

Du solltest für jede Variable den Operator /= verwenden.

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

Du solltest den Code oberhalb des vorgegebenen Kommentars nicht verändern.

assert(
  /let a = 48;/.test(code) &&
    /let b = 108;/.test(code) &&
    /let c = 33;/.test(code)
);

--seed--

--after-user-code--

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

--seed-contents--

let a = 48;
let b = 108;
let c = 33;

// Only change code below this line
a = a / 12;
b = b / 4;
c = c / 11;

--solutions--

let a = 48;
let b = 108;
let c = 33;

a /= 12;
b /= 4;
c /= 11;