스코프는 계층적이며 트리의 맨 아래에는 바탕이 되는 무언가가 있어야 합니다. 즉, 프로그램
을 시작할 때 암시적으로 주어지는 스코프가 필요합니다. 이 스코프를
전역 스코프
라고 합니
다. 자바스크립트 프로그램을 시작할 때, 즉 어떤 함수도 호출하지 않았을 때 실행 흐름은 전역
스코프에 있습니다. 바꿔 말해, 전역 스코프에서 선언한 것은 무엇이든 프로그램의 모든 스코
프에서 볼 수 있습니다.
전역 스코프에서 선언된 것들을
전역 변수
2
라고 합니다. 전역 변수는 아주 안 좋은 평가를 받고
있습니다. 프로그래밍 책을 읽다 보면, 전역 변수를 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.