Skip to content

Instantly share code, notes, and snippets.

@sungjaeHong
Created September 6, 2016 01:24
Show Gist options
  • Save sungjaeHong/19da6a6d855d0b9a82dec4128edfee89 to your computer and use it in GitHub Desktop.
Save sungjaeHong/19da6a6d855d0b9a82dec4128edfee89 to your computer and use it in GitHub Desktop.

#ECMA 2015 INSIDE

ECMA 특징

  • 2015년 6월 17일 정식버전채용
  • Be a Better Language
  • ECMA 스펙의 가장 큰 변화
  • ES5의 완벽한 상위 집합

단점

  • 이전 버전의 문제점을 여전히 안고있음
  • 그러나 점진적으로 개선해나갈 예정임

###New features

  • Classes
  • Modules
  • new method for string and Arrays
  • promisses

###ECMA 2015의 꽃

  • Promise
  • Generator
  • Generator + Promise

promise

const p = new Promise(function(resolve, reject){ if(success){ resolve("success"); } else{ reject"error"); } });

p.then(resolved, rejected);

실무에선 new promise를 잘 쓰지 않는다.

##변경된 점 Job Queue : 이벤트 동작은 동일, 다만 큐에 담아서 순차적으로 작업함. 다만 job queue에서 장애 발생 시 다음 작업도 수행되지 못함.

##yield

  • 2015 이전까지는 완전수행이었으나 2015부터 yield를 만나면 호출한 곳으로 제어권을 넘긴다

https://github.com/shallaa/async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment