https://leanpub.com/understandinges6/read#leanpub-auto-better-unicode-support 을 정리한 내용입니다. 향상된 유니코드 지원ECMAScript 5 까지는 16-bit 문자 인코딩 방식(UTF-16)을 사용했다.length와 charAt()은 16-bit 단위로 계산되었다.그러나 Unicode는 16 bits만으로 표현되지 않는다. var text = "𠮷"; console.log(text.length); // 2 console.log(/^.$/.test(text)); // false console.log(text.charAt(0)); // "" console.log(text.charAt(1)); // "" console.log(text.charC..
https://leanpub.com/understandinges6/read#leanpub-auto-block-bindings 을 정리한 내용입니다.자바스크립트에는 두 가지 scope가 존재한다.Local scope : 함수 범위Global scope : 전역 범위var로 변수를 선언하면, 해당 scope의 맨 위에서 선언한 것처럼 처리된다. (hoisting) function myFunc(condition) { if (condition) { console.log(a); // undefined } else { var a = 1; console.log(a); // 1 } console.log(a); // undefined } 실제로는 아래와 같다. function myFunc(condition) { var ..