let n = 4;
let k = n++; // k=4, n=5
let k = ++n; // k=6, n=6
개발자가 말하고자 하는 바가 명확해진다.
반복문에선 n++ 보다 ++n 의 성능이 더 좋다.(int 형은 컴파일러 최적화로 별차이 없고, iterator의 경우 효과가 있다)
참고
Why is n++ faster than n=n+1?
Mario Galindo Queralt's answer: I see that others have explained you why [code ]n++[/code] is faster than [code ]n=n+1[/code]. I, will not repeat that. However I want to say you that [code ]++n[/code] could be even faster. This is because [code ]n++[/code]
www.quora.com
프론트엔드 개발자로서 고려해야될 것
Why are JavaScript and front-end engineers paid so high even though their jobs are so easy?
Nick Brombal's answer: > “Why are Javascript and Front end engineers paid so high even though their jobs are so easy?” Individuals who find front-end development to be easy generally fall into one of two categories. 1. Those who are gifted. 2. Those wh
www.quora.com
'ELSE' 카테고리의 다른 글
코딩 컨벤션 (0) | 2021.09.07 |
---|---|
컴퓨터 운영체제 몇 비트인지 확인하기 (0) | 2019.08.14 |
블로그에 광고 달기, HTML 편집해서 본문 & 메뉴 광고달기 (Google Adsense) (0) | 2019.04.18 |
Tistory 블로그 광고 달기, 구글 애드센스 (본문에 광고) (0) | 2019.04.18 |
git 계정 변경, Git Permission denied 될 때 (1) | 2019.04.05 |