The document discusses scope in programming languages. There are three types of scope: global scope, which is available everywhere; function scope, where variables are only available within a function; and block scope, where variables are only available within a code block. Lexical scope means that scope is determined statically based on the structure of the code.
Story of static code analyzer developmentAndrey Karpov
Greetings from the past: simple tools and bad standards. Regular expressions don’t work. What is inside modern static code analyzers on the PVS-Studio example. About machine learning. Learning vs Data Flow analysis.
Story of static code analyzer developmentAndrey Karpov
Greetings from the past: simple tools and bad standards. Regular expressions don’t work. What is inside modern static code analyzers on the PVS-Studio example. About machine learning. Learning vs Data Flow analysis.
Have ever heard that JavaScript is event-oriented? And that Node.js has a mainloop? Have you ever had issues with setTimeout, setInterval, setImmediate, nextTick order? This talk should help you with understanding deeply Node.js and Web event loop phases!
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
Szybkie wprowadzenie do technologii Pig i Hive z ekosystemu Hadoop. Prezentacja wykonana w ramach warsztatów Codepot w dniu 29.08.2015. Prezentacja wykonana przez Radosława Stankiewicza oraz Bartłomieja Tartanusa.
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemSages
Introduction to Hadoop Map Reduce, Pig, Hive and Ambari technologies.
Workshop deck prepared and presented on September 5th 2015 by Radosław Stankiewicz.
During that the day participants had also the possibility to go through prepared tutorials and test their analysis on real cluster.
Lisp Macros in 20 Minutes (Featuring Clojure)Phil Calçado
"We just started holding 20 minutes presentations during lunch time in the ThoughtWorks Sydney office. For the first session I gave a not-that-short talk on Lisp macros using Clojure. The slides are below.
It turns out that 20 minutes is too little time to actually acquire content but I think at least we now have some people interested in how metaprogramming can be more than monkey patching."
http://fragmental.tw/2009/01/20/presentation-slides-macros-in-20-minutes/
Cluj Big Data Meetup - Big Data in PracticeSteffen Wenz
At the Cluj Big Data Meetup, we shared some insights into TrustYou's big data tech stack. Also we introduced two tools which we've found useful in our production jobs: Apache Pig and Luigi.
Also check out the code samples on GitHub: https://github.com/trustyou/meetups/tree/master/big-data
Shift Remote FRONTEND: Reactivity in Vue.JS 3 - Marko Boskovic (Barrage)Shift Conference
In previous versions of Vue we needed abstracted patterns like Higher Order Components (HOC), mixins or props to implement reactivity. The new functional API gives us the ability to encapsulate and reuse logic across multiple components without those abstracted patterns.
New and delete are a thing of the past, with the new features in C++14 and beyond (such as smart pointers and move semantics) memory management is easier and safer. Learn how to use the new constructs of C++14 and beyond to create, move, and free objects in a safer and more efficient manner.
This is the slide for what I shared in JS Group meetup, 2014, Taiwan. It covers what JavaScript could do for making the program more "functional", the benefits, price and the limitation.
Have ever heard that JavaScript is event-oriented? And that Node.js has a mainloop? Have you ever had issues with setTimeout, setInterval, setImmediate, nextTick order? This talk should help you with understanding deeply Node.js and Web event loop phases!
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
Szybkie wprowadzenie do technologii Pig i Hive z ekosystemu Hadoop. Prezentacja wykonana w ramach warsztatów Codepot w dniu 29.08.2015. Prezentacja wykonana przez Radosława Stankiewicza oraz Bartłomieja Tartanusa.
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemSages
Introduction to Hadoop Map Reduce, Pig, Hive and Ambari technologies.
Workshop deck prepared and presented on September 5th 2015 by Radosław Stankiewicz.
During that the day participants had also the possibility to go through prepared tutorials and test their analysis on real cluster.
Lisp Macros in 20 Minutes (Featuring Clojure)Phil Calçado
"We just started holding 20 minutes presentations during lunch time in the ThoughtWorks Sydney office. For the first session I gave a not-that-short talk on Lisp macros using Clojure. The slides are below.
It turns out that 20 minutes is too little time to actually acquire content but I think at least we now have some people interested in how metaprogramming can be more than monkey patching."
http://fragmental.tw/2009/01/20/presentation-slides-macros-in-20-minutes/
Cluj Big Data Meetup - Big Data in PracticeSteffen Wenz
At the Cluj Big Data Meetup, we shared some insights into TrustYou's big data tech stack. Also we introduced two tools which we've found useful in our production jobs: Apache Pig and Luigi.
Also check out the code samples on GitHub: https://github.com/trustyou/meetups/tree/master/big-data
Shift Remote FRONTEND: Reactivity in Vue.JS 3 - Marko Boskovic (Barrage)Shift Conference
In previous versions of Vue we needed abstracted patterns like Higher Order Components (HOC), mixins or props to implement reactivity. The new functional API gives us the ability to encapsulate and reuse logic across multiple components without those abstracted patterns.
New and delete are a thing of the past, with the new features in C++14 and beyond (such as smart pointers and move semantics) memory management is easier and safer. Learn how to use the new constructs of C++14 and beyond to create, move, and free objects in a safer and more efficient manner.
This is the slide for what I shared in JS Group meetup, 2014, Taiwan. It covers what JavaScript could do for making the program more "functional", the benefits, price and the limitation.
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016STX Next
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice for Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and keeping short compile times on the other.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up a kotlin-based Android project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin compilation is presented and the language is compared to SCALA and SWIFT.
StxNext Lightning Talks - Feb 12, 2016
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice when it comes to Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and on the other - keeping short compile times.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up an Android-kotlin project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin usage is presented and the language is compared to SCALA and SWIFT.
Functional Programming You Already KnowKevlin Henney
Presented at NDC 2013 in Oslo (13th June 2013)
Video available on Vimeo: https://vimeo.com/68327245
From JVM to .NET languages, from minor coding idioms to system-level architectures, functional programming is enjoying a long overdue surge in interest. Functional programming is certainly not a new idea and, although not apparently as mainstream as object-oriented and procedural programming, many of its concepts are also more familiar than many programmers believe.
This talk examines functional and declarative programming styles from the point of view of coding patterns, little languages and programming techniques already familiar to many programmers.
This is a presentation which was presented on Innovecs Tech Hangout in Kiev June 2017.
Includes
- Pure Functions
- Currying
- Function Composition
- Functors
- Monads
C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
This reference will take you through simple and practical approach while learning C++ Programming language.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
4. Global Scope
Function Scope
Block Scope
프로그램 전체적으로 접근할 수 있는
최상위 유효범위, 이 유효범위는 host
객체와 연관되며 브라우저는 window
Node.js에는 global로 존재함
함수 내에서만 변수가 저장되고
접근할 수 있는 유효범위
블록 내에서만 변수가 저장되고
접근할 수 있는 유효범위
let, const(ECMAScript 6)
13. Global Scope
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
14. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
15. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(something)
17. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(something)
Lexical Scope
(print)
18. Global Scope
Lexical Scope
(print)
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Lexical Scope
(something)
20. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
21. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
22. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
23. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
24. ☛ function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
25. ☛ function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
26. ☛ function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
27. ☛ function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
28. ☛ function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
29. ☛ function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
30. ☛ function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
31. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
32. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
33. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
34. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
35. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
36. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
37. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
38. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
39. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
40. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 23
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
41. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
42. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
43. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
44. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
45. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
46. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
3
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
47. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
48. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
3
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
49. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
3
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
50. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
3
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
51. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
52. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
53. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
54. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
55. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
56. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
57. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
58. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
59. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
60. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
61. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
62. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 2
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
63. ☛
function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
1 2 3
Global Scope
Lexical Scope
(print)
Lexical Scope
(something)
65. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
66. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
67. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
☛
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
68. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
☛
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
69. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
☛
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
70. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
☛
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
71. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
☛
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
72. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
a = 20;
}
innerFunc();
}
outerFunc();
☛
[Left Hand Side]
* 변수가 Global 스코프에 있다면 전달
* 없다면 Global 스코프에 생성하여 전달
* ’use strict’ 모드에서는 ReferenceError 발생
73. function outerFunc() {
function innerFunc() {
var a = b + 10;
}
innerFunc();
}
outerFunc();
[Right Hand Side]
* 변수가 Global 스코프에 있다면
변수에 저장된 값 전달
* 없다면 ReferenceError 발생
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
74. ☛
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
function outerFunc() {
function innerFunc() {
var a = b + 10;
}
innerFunc();
}
outerFunc();
[Right Hand Side]
* 변수가 Global 스코프에 있다면
변수에 저장된 값 전달
* 없다면 ReferenceError 발생
75. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
function outerFunc() {
function innerFunc() {
var a = b + 10;
}
innerFunc();
}
outerFunc();
[Right Hand Side]
* 변수가 Global 스코프에 있다면
변수에 저장된 값 전달
* 없다면 ReferenceError 발생
76. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
function outerFunc() {
function innerFunc() {
var a = b + 10;
}
innerFunc();
}
outerFunc();
[Right Hand Side]
* 변수가 Global 스코프에 있다면
변수에 저장된 값 전달
* 없다면 ReferenceError 발생
77. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
function outerFunc() {
function innerFunc() {
var a = b + 10;
}
innerFunc();
}
outerFunc();
[Right Hand Side]
* 변수가 Global 스코프에 있다면
변수에 저장된 값 전달
* 없다면 ReferenceError 발생
78. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
function outerFunc() {
function innerFunc() {
var a = b + 10;
}
innerFunc();
}
outerFunc();
[Right Hand Side]
* 변수가 Global 스코프에 있다면
변수에 저장된 값 전달
* 없다면 ReferenceError 발생
79. Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
function outerFunc() {
function innerFunc() {
var a = b + 10;
}
innerFunc();
}
outerFunc();
[Right Hand Side]
* 변수가 Global 스코프에 있다면
변수에 저장된 값 전달
* 없다면 ReferenceError 발생
80. Shadow variable 동일한 식별자의 변수가 하위 스코프에
존재할 때 버블링이 중지되고 상위
스코프까지 탐색하지 않게 만드는 변수
81. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
82. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
83. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
84. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
85. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
86. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
87. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
88. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
89. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
90. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
91. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
92. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
93. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
94. var a = 20;
var b = 5;
function outerFunc() {
var b = 10;
function innerFunc() {
var c = a + b;
}
innerFunc();
}
outerFunc();
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
Lexical Scope
(outerFunc)
Global Scope
Lexical Scope
(innerFunc)
☛
108. function something() {
const a = 10;
const b = 20;
{
const c = a + b;
console.log(c); // 30
}
console.log(c); // ??????????????
}
something();
109. function something() {
const a = 10;
const b = 20;
{
const c = a + b;
console.log(c); // 30
}
console.log(c); // ??????????????
}
something();
110. function something() {
const a = 10;
const b = 20;
{
const c = a + b;
console.log(c); // 30
}
console.log(c); // ReferenceError
}
something();
111. function something() {
console.log(a); // ?????????
console.log(b); // ?????????
var a, b;
// do something...
}
function something() {
console.log(a); // ??????????????
console.log(b); // ??????????????
let a, b;
// do something...
}
112. function something() {
console.log(a); // ?????????
console.log(b); // ?????????
var a, b;
// do something...
}
function something() {
console.log(a); // ??????????????
console.log(b); // ??????????????
let a, b;
// do something...
}
113. function something() {
console.log(a); // undefined
console.log(b); // undefined
var a, b;
// do something...
}
function something() {
console.log(a); // ReferenceError
console.log(b); // Not running
let a, b;
// do something...
}
115. function something() {
var a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(var i = 0, n = a; i < n; i++) {
var b = a * i;
}
}
116. function something() {
var a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(var i = 0, n = a; i < n; i++) {
var b = a * i;
}
}
Lexical Scope
(something)
117. function something() {
var a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(var i = 0, n = a; i < n; i++) {
var b = a * i;
}
}
Lexical Scope
(something)
118. function something() {
var a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(var i = 0, n = a; i < n; i++) {
var b = a * i;
}
}
Lexical Scope
(something)
119. function something() {
var a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(var i = 0, n = a; i < n; i++) {
var b = a * i;
}
}
Lexical Scope
(something)
컴파일 단계에서 변수 선언문을 가장 먼저 해석
연관된 렉시컬 스코프에 변수를 연결
120. function something() {
var a;
var i;
var n;
var b;
a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(i = 0, n = a; i < n; i++) {
b = a * i;
}
}
121. function something() {
var a;
var i;
var n;
var b;
a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(i = 0, n = a; i < n; i++) {
b = a * i;
}
}
122. function something() {
var a;
var i;
var n;
var b;
a = 10;
console.log(a); // 10
console.log(i); // undefined;
console.log(n); // undefined;
console.log(b); // undefined;
for(i = 0, n = a; i < n; i++) {
b = a * i;
}
}
마치 변수를 끌어올려서 실행하는
모양과 같다하여 Hoisting이라고 함
128. Lexical Scope
(something)
함수 표현식일때는 변수 선언만
끌어올린다. 함수는 값으로써 실행
시점에 대입된다.
function something() {
console.log(innerFunc); // undefiend
innerFunc(); // ReferenceError
var innerFunc = function() {
// do something...
};
}
something();
129. function something() {
console.log(innerFunc); // ????????
innerFunc(); // ?
function innerFunc() {
console.log(1);
}
var innerFunc = function() {
console.log(2);
}
innerFunc(); // ?
}
something();
130. function something() {
console.log(innerFunc); // ????????
innerFunc(); // ?
function innerFunc() {
console.log(1);
}
var innerFunc = function() {
console.log(2);
}
innerFunc(); // ?
}
something();
Lexical Scope
(something)
131. function something() {
console.log(innerFunc); // ????????
innerFunc(); // ?
function innerFunc() {
console.log(1);
}
var innerFunc = function() {
console.log(2);
}
innerFunc(); // ?
}
something();
Lexical Scope
(something)
innerFunc는 이미 Scope 내에
존재하므로 무시
154. From the executable code associated with the
currently running execution context to executable code that
is not associated with that execution context.
155. code evaluation
From the executable code associated with the
currently running execution context to executable code that
is not associated with that execution context.
156. code evaluation
Global Code
Function Code
Eval Code
From the executable code associated with the
currently running execution context to executable code that
is not associated with that execution context.
157. code evaluation Initializing execution context
Initializing execution context
Initializing execution context
Global Code
Function Code
Eval Code
From the executable code associated with the
currently running execution context to executable code that
is not associated with that execution context.
206. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Execution Context
(something)
207. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Execution Context
(something)
this : ResolveThisBinding()
208. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Execution Context
(something)
this : ResolveThisBinding()
209. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Execution Context
(something)
this : global
213. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Execution Context
(something)
LexicalEnvironment : { … },
VariableEnvironment: { … },
this : global
214. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
215. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);☛
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
outerEnvironmentReference GlobalEnvironmentRecord➠
216. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛ Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
217. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛ EnvironmentRecord
(something)
print: FunctionReference
a: undefined,
b: undefined,
c: undefined
218. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛ EnvironmentRecord
(something)
print: FunctionReference
a: 1,
b: 2,
c: undefined
219. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
EnvironmentRecord
(something)
print: FunctionReference
a: 1,
b: 2,
c: 3
220. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
EnvironmentRecord
(something)
print: FunctionReference
a: 1,
b: 2,
c: 3
221. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(something)
Execution Context
(Global)
⚑
222. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(something)
Execution Context
(Global)
⚑
Execution Context
(print)
223. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(something)
Execution Context
(Global)
⚑ Execution Context
(print)
224. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
225. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
outerEnvironmentReference LexicalEnvironmentRecord of something
Execution Context
(print)
➠
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
226. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
EnvironmentRecord
(print)
z: undefined
227. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
EnvironmentRecord
(print)
z: undefined
228. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
EnvironmentRecord
(print)
z: 3
229. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
230. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
231. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
232. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
`a` variable is not in EnvironmentRecord of print
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
233. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
234. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
outerEnvironmentReference LexicalEnvironmentRecord of something
Execution Context
(print)
➠
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
235. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
EnvironmentRecord
(something)
print: FunctionReference
a: 1,
b: 2,
c: 3
236. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
EnvironmentRecord
(something)
print: FunctionReference
a: 1,
b: 2,
c: 3
Execution Context
(print)
237. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
EnvironmentRecord
(something)
print: FunctionReference
a: 1,
b: 2,
c: 3
Execution Context
(print)
238. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
239. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
EnvironmentRecord
(print)
z: 3
240. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
print(c);
}
something(1, 2);
☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
EnvironmentRecord
(print)
z: 3
Execution Context
(print)
241. var a = 10;
function outerFunc() {
function innerFunc() {
console.log(a);
}
innerFunc();
}
outerFunc();
☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
Execution Context
(innerFunc)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
Execution Context
(outerFunc)
EnvironmentRecord
(global)
a: 10
242. 어떤 함수가 선언된 환경을 벗어나
실 행 돼 도 선 언 된 시 점 의 상 위
환경(스코프)에 접근할 수 있게
되는 기능
Closure
243. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
244. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
245. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
246. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
[[closure]] :
print Function
247. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
print Function
[[closure]] : LexicalEnvironment
(something)
248. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
print Function
[[closure]] : LexicalEnvironment
(something)
249. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
print Function
[[closure]] : LexicalEnvironment
(something)
250. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
print Function
[[closure]] : LexicalEnvironment
(something)
251. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
Execution Context
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
☛
print Function
[[closure]] : LexicalEnvironment
(something)
252. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
☛
print Function
[[closure]] : LexicalEnvironment
(something)
253. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();☛
254. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
255. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
print Function
[[closure]] : LexicalEnvironment
(something)
256. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
print Function
[[closure]] : LexicalEnvironment
(something)
257. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
print Function
[[closure]] : LexicalEnvironment
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
258. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
print Function
[[closure]] : LexicalEnvironment
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
259. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
LexicalEnvironment
(something)
260. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
LexicalEnvironment
(something)
261. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
☛
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
LexicalEnvironment
(something)
262. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
LexicalEnvironment
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
263. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
LexicalEnvironment
(something)
`a` variable is not in
EnvironmentRecord of print
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
264. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
LexicalEnvironment
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global
265. function something(a, b) {
var c = a + b;
function print(z) {
console.log(`${a} + ${b} =`, z);
}
return print(c);
}
const log = something(1, 2);
log();
☛
Execution Context
(print)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
}
LexicalEnvironment
(something)
LexicalEnvironment : {
EnvironmentRecord,
OuterLexicalEnvironment
},
VariableEnvironment: {
EnvironmentRecord,
OuterLexicalEnvironment
}
this : global