본문 바로가기

Python_WEB/JavaScript

[freecodecamp]JavaScript 숫자 줄이기

반응형

- 연산자를 사용하여 변수를 1 씩 쉽게 줄일 수 있습니다.

 

i--;

 

다음과 같습니다.

 

i = i - 1;

 

전체 라인은 i--;가되어 등호가 필요하지 않습니다.

 

Q>

1. myVar에서-연산자를 사용하도록 코드를 변경합니다.

2. myVar는 10이어야합니다.

3. myVar = myVar-1; 변경해야합니다.

4. myVar에서-연산자를 사용해야합니다.

5. 지정된 주석 위의 코드를 변경해서는 안됩니다.

 

A>

var myVar = 11;

// Only change code below this line
myVar--;

 

https://www.freecodecamp.org/

 

freeCodeCamp.org

Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.

www.freecodecamp.org

 

반응형