Objects and functions
Objects and the dot
物件裡面可以包含三種東西
Primitive (property)
Object (property)
Function (method)
核心物件會有一個記憶體的位址,可以參考到這些電腦記憶體中的屬性(property)和方法(method)的位址空間,如下圖。
Syntax parsers 語法解析器
A program that reads your code and determines what it does and if its grammar is valid.
Your code isn't magic. Someone else wrote a program to translate it for the computer.
Execution contexts 執行環境
A wrapper to help manage the code that is running.
There are lost sof lexical environments. Which one is currently running is managed via execution contexts. It can contain things beyond what you've written in your code.
Lexical environment 詞彙環境
Dynamic Type (弱型別)
You don't tell the engine what type of data a variable holds, it figures it out while your code is running
- Variables can hold different types of values because it's all figured out during execution
//Static Typing
bool isNew = 'hello'; // an error
//Dynamic Typing
Var isNew = true; // no errors
isNew = 'yup';