Files
freeCodeCamp/curriculum/challenges/korean/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-subtraction.md
2024-05-20 09:39:48 -07:00

1.5 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
56533eb9ac21ba0edf2244b0 빼기를 추가해서 복합적으로 할당하기 1 https://scrimba.com/c/c2Qv7AV 16660 compound-assignment-with-augmented-subtraction

--description--

+= 연산자처럼, -=는 변수에서 수를 뺍니다.

myVar = myVar - 5;

위의 내용은 myVar에서 5를 뺍니다. 이 내용은 아래와 같이 다시 쓸 수 있습니다.

myVar -= 5;

--instructions--

a, b, c에 각각 할당을, -= 연산자를 사용하도록 변경해주세요.

--hints--

a5와 같아야 합니다.

assert(a === 5);

b-6과 같아야 합니다.

assert(b === -6);

c2와 같아야 합니다.

assert(c === 2);

각 변수에 -= 연산자를 사용해야 합니다.

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

지정된 코멘트 위의 코드를 변경하면 안됩니다.

assert(
  /let a = 11;/.test(__helpers.removeJSComments(code)) && /let b = 9;/.test(__helpers.removeJSComments(code)) && /let c = 3;/.test(__helpers.removeJSComments(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;