TIL 34 (2020.09.03) JS

백은진·2020년 9월 4일
0

TIL (Today I Learned)

목록 보기
34/106

BROWSER COMPATIBILITY AND TRANSPILATION

자바스크립트 ES6 업데이트로 인해 기존에 사용하던 ES5 언어와 크고 작은 차이가 발생했다.
기존의 브라우저도 ES5에 맞춰져 있었기에 ES6에 대한 업데이트가 모두 이루어진 것은 아니다.

따라서, 개발자는 브라우저와 ES6가 잘 호환되도록 수정을 하는 작업을 진행해서
사용자들이 별다른 불편함을 느끼지 못하게 작업을 해야한다.

해당 강의에서는 npm을 통해 babel을 설치해서 그 작업을 하는 방법을 배웠다.

그러나, 터미널 상에서 이런저런 작업을 하는 일은 내게 꽤 어려웠고
이 부분에 조금 있던 흥미마저 점점 사라졌다.

모든 브라우저의 적합성을 알려주는 사이트가 있다.
각 언어의 업데이트 별로도 확인할 수 있다.

Module

Modules in Node.js are reusable pieces of code that can be exported from one program and imported for use in another program.

  • module.exports exports the module for use in another program.

  • require() imports the module for use in the current program.
    ES6 introduced a more flexible, easier syntax to export modules:

  • default exports use export default to export JavaScript objects, functions, and primitive data types.

  • named exports use the export keyword to export data in variables.

  • named exports can be aliased with the as keyword.

  • import is a keyword that imports any object, function, or data type.

profile
💡 Software Engineer - F.E

0개의 댓글