Udemy/JavaScript:Understanding the weird part 썸네일형 리스트형 The Scope Chain function b(){ Execution Context console.log(myVar);myVar 1 (Reference to Outer Environment) > Global Execution Context } function a(){Execution Context var myVar = 2;myVar 2 (Reference to Outer Environment) > Global Execution Context b(); } var myVar = 1;Global Execution Context a();myVar 1 // 1 function b의 경우 myVar을 찾을 수 없어서 outer environment를 참조 b() > a() > Global Execution Context 이러한 것을 스코프 .. The 'new' keyword Creates an object out of thin airAssigns the value of 'this' to be that objectAdds 'return this' to the end of the functionCreates a link(which we can access as _proto_) between the object created and the prototype property of the constructor function closure and keyword 'this' 'CLOSURE' 외부 함수의 변수에 접근할 수 있는 내부 함수 Closure only exists when an inner function makes use of variables defined from an outer function that has returned. Closure does not exist if you do not return an inner function and if that inner function does not make use of variables returned by an outer function. JavaScript will only remember values that are being used inside of the inner function, not all .. Object-Oriented Javascript and Prototypal Inheritance Inheritance: One object gets access to the properties and methods of another object Reflection : An object can look at itself, Listening and changing its properties and methods Objects and Functions Function Statement : initially put in to memory, but have to invoke it for it to execute 함수 선언식은 항상 상단으로 show(); function show() { console.log('displayed!'); } Function Expression( not hoisted ) + ( parameter ) = Immediately Invoked Function Expression(IIFE) : A unit of code that results in a value not initially put in to memory, when it hits this line it creates this function object on the fly... Types and Operators Primitive Type (Undefine, Null, Boolean, Number, String, Symbol): A type of data that represents a single value Undefine: represents lack of existence (you shouldn't set a variable to this)Null: represents lack of existence (you can set a variable to this) Operator: A special function that is syntactically (Written) differently Generally, operators take two parameters and return one result Execution Contexts and Lexical Environments Syntax Parser: A program that reads your code and determines what it does and If it grammar is valid(character by character, using a set of rules for what's valid syntax and decide what is your intend) Lexical Environment: Where something sits physically in the code you write'Lexical' means 'having to do with words or grammer'. A lexical environment exists in programming languages in which where.. 이전 1 다음