Files
freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.md
2022-10-20 09:13:17 -07:00

1.5 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
56533eb9ac21ba0edf2244b0 التخصيص المركب مع الطرح المعزز (Compound Assignment With Augmented Subtraction) 1 https://scrimba.com/c/c2Qv7AV 16660 compound-assignment-with-augmented-subtraction

--description--

مثل مشغل +=, يقوم مشغل-= بطرح رقماً من متغير.

myVar = myVar - 5;

سيتم طرح 5 من myVar. ويمكن إعادة كتابة هذا على النحو التالي:

myVar -= 5;

--instructions--

حول التعيينات a, و b, و c لتستخدم المشغل -=.

--hints--

يجب أن يساوي a قيمة 5.

assert(a === 5);

يجب أن يساوي b قيمة -6.

assert(b === -6);

يجب أن يساوي c قيمة 2.

assert(c === 2);

يجب عليك استخدام مشغل -= لكل متغير.

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

لا يجب عليك تعديل الكود فوق التعليق المحدد.

assert(
  /let a = 11;/.test(code) && /let b = 9;/.test(code) && /let c = 3;/.test(code)
);

--seed--

--after-user-code--

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

--seed-contents--

let a = 11;
let b = 9;
let c = 3;

// Only change code below this line
a = a - 6;
b = b - 15;
c = c - 1;

--solutions--

let a = 11;
let b = 9;
let c = 3;

a -= 6;
b -= 15;
c -= 1;