Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 등차수열의 항 찾기
- 쌍방향 연결리스트
- 고차함수
- 배열의 오름차순
- 배열의 내림차순
- 가상 요소 선택자
- 객체
- CSS
- nth-child()
- Link
- map()
- Sort
- visibility : hidden
- 배열과 연결리스트의 차이
- 일반 형제 선택자 결합
- classList.contains(string)
- 범용 선택자
- 인접 형제 선택자 결합
- innerhtml
- 백준알고리즘
- indexOf
- 양방향 연결리스트
- invalid assignment left-hand side
- Em
- 단방향 연결리스트
- filter()
- for..of
- disabled
- display : none
- Array.from()
Archives
- Today
- Total
프론트엔드 센트럴파크 (☞゚ヮ゚)☞
연산자 본문
++(더하기)연산자를 사용할 때 ++위치에 따라 값이 다르게 나온다.
let num, result;
num = 10;
result = num++;
console.log(result);
console.log(num);
console.log(result);
num을 복사할 시점에 result는 10이다.
console.log(num);
num값은 그 다음시점부터 적용이 되어서 ++한 값인 11이 된다.
let num, result;
num = 10;
result = ++num;
console.log(result);
console.log(num);
console.log(result);
++가 앞에 있기 때문에 ++를 반영하고 11인 상태에서 result로 복사된다.
console.log(num);
이미 11인 상태에서 num값 호출하였기 때문에 11이다.
++ 연산자와 -- 연산자 둘 다 동일하게 적용된다.
'Javascript' 카테고리의 다른 글
3항 연산자 (0) | 2022.04.30 |
---|---|
논리 연산자 &&( and), ||(or), !(not) (0) | 2022.04.29 |
얕은복사 (0) | 2022.04.28 |
깊은복사 (0) | 2022.04.28 |
createElement(), createTextNode(), appendChild() (0) | 2022.04.13 |
Comments