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 | 31 |
Tags
- 클라이언트
- ftech
- Instantiation Patterns
- DOM
- JS
- JavaScript
- 공부
- 일상
- method
- 포스기
- react
- 개발
- 알고리즘
- vscode
- array
- grpahQL
- underbar
- underscores
- this
- 리액트
- 자바스크립트
- 해커톤
- 코드스테이츠
- 엔퀸즈
- nqueens
- 취업
- 코딩
- 연습
- 제일어려워
- 초보
Archives
- Today
- Total
analogcoding
arrow function 예시 본문
let arr = [1,2,3,4].map(function(v){
return v * 2;
});
ES5
let arr2 = [1,2,3,4].map( (v)=>{
return v * 2;
})
ES6
let arr2 = [1,2,3,4].map( (v) =>( v * 2))
축약
기존 function 보다 짧게 , 가독성 있게 사용할 수 있다.
ES6 이전
setTimeOut(function(){
console.log('hello')
},1000)
ES6 arrow function
setTimeOut( ()=>{
console.log('arrow');
},1000)
'Study JS for me > Keyword' 카테고리의 다른 글
| Destructuring (0) | 2019.05.14 |
|---|---|
| arrow function 의 this context (0) | 2019.05.14 |
| Object property (0) | 2019.05.13 |
| spread operator / rest parameter (0) | 2019.05.13 |
| Arrow function (0) | 2019.05.11 |
Comments