티스토리 뷰
[20210706] 모던 자바스크립트(javascript) 개발을 위한 ES6 강좌 - arrow function
개발자와코더사이가 PM일까? 2021. 7. 11. 21:50* 강의를 듣으면서 느끼는 점인데 5시간 강의를 듣는다고해서 내가 ES6를 잘 모를 것 같다.
다만 예전에 소스에 보았던 특이한점을 배울 수가 있고 또한 단어에 익숙해지는 느낌이 든다.
* arrow function : =>
==> setTimeout( ()=> {console.log("1111")}, 1000);
* arrow this context
==> bind를 생략해도 내부에 this를 가져올 수 있다.
* function default paramters
==> function sum(value, key=1) {
reutrn value * key;
}
==> function sum(value, kkk={k:1}) {
..
}
* rest paramaters
==> n개의 인자가 넘어올때
function testnum() {
//ES5일때
//arguments 하나의 객체이고 aragument는 가짜 배열이기 때문에 진짜 배열로 변경해야 한다.
const argArray = array.prototype.slice.call(arguments);
console.log(toString.call(arguments));
const result = argAttay.every((v) =< typeof v === "number)
}
//...argArray => 스프린트를 매개변수로 받으면 배열로 받는다.
function checknNum(...argArray) {
}
* Class
=> ES 5 Class
==>
function bone() {
this.name = name;
}
Health.prototype.showHealth = function () {
console.log(this.name);
}
=> ES 6 Class
//constructor 키워드고 결국에는 class가 아니라 함수로 연결된 녀석이다.
class Health {
constructor (name, lastTime) {
..
}
* Object assign
==>
constg healthObj = {
console.log("ddddd"+this.lastTime);
}
}
//Object.create
const ttt = Object.create(healthObj);
const ttt2 = Object.assign(Object.create(healthObj) , {
name: "ttt", lastTime : "222" } );
* object setPrototypeOf
- Total
- Today
- Yesterday
- 담양 죽녹원
- 덤프
- PPTX
- 인천여행
- 테라로사
- oracle
- ora-01940
- 정동지
- 밀리세컨드
- jdk
- 파주여행
- 부천역
- pdf ms워드 변환
- 임자도
- 토드
- java api
- 제주도여행
- 맛집
- 가평여행
- 인스타그램
- 산외한우마을
- 오라클
- 대관령양떼목장
- 가평팬션
- 보성녹차밭
- 이클립스
- 인천
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |