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
- 알고리즘
- underbar
- 포스기
- 코드스테이츠
- 해커톤
- react
- JS
- ftech
- 연습
- 리액트
- this
- 취업
- 초보
- DOM
- 일상
- 클라이언트
- 코딩
- 자바스크립트
- vscode
- 엔퀸즈
- nqueens
- underscores
- method
- 개발
- 제일어려워
- Instantiation Patterns
- 공부
- grpahQL
- array
- JavaScript
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