ECMAScript 개요

lbr·2022년 7월 7일
0

ECMAScript

JavaScript 타입 확인

typeof 'Hello world!'
typeof 123
typeof true
typeof undefined
typeof null
typeof {}
typeof []

결과

string
number
boolean
undefined
object
object
object
  • 위의 typeof {데이터}로는 null[]는 obejct로 나옵니다.
Object.prototype.toString.call(data).slice(8, -1)
  • 위의 리턴값으로 null, []Null, Array로 제대로 출력됩니다.

npm 명령어

  • npm init -y : 프로젝트 관리 시작합니다.
  • npm install parcel-bundler -D 개발의존성으로 parcel-bundler를 설치합니다.
  • npm run dev : 개발서버를 엽니다.

package.json 셋팅

0개의 댓글