Skip to content

Instantly share code, notes, and snippets.

@BurningDroid
Last active March 5, 2019 15:45
Show Gist options
  • Save BurningDroid/7dca6ca6a3932b850be2b43e4283a92b to your computer and use it in GitHub Desktop.
Save BurningDroid/7dca6ca6a3932b850be2b43e4283a92b to your computer and use it in GitHub Desktop.
javascript - strict mode

Strict Mode

암시적 전역 변수를 허용하지 않는 모드. ES6부터는 "use strict"를 코드 맨 앞에 적으면, strict mode로 동작하게 된다.

전역 스코프에서 사용하면 스크립트 전체가, 함수 안에서 사용하면 해당 함수에만 적용된다.

ref: 러닝 자바스크립트 (Learning JavaScript)

암시적 전역 변수

var 변수를 선언하지 않으면, 전역 변수를 참조하려 하고 만약 전역 변수도 존재하지 않으면 만들어 버림

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