@@ -176,7 +179,7 @@
JavaScript
Client-side (browser) and server-side (node.js, AppsScript)
Standard
- - Current stable release is ECMAScript 2020
+ - Current stable release is ECMAScript 2021/June 2021
Major characteristics
@@ -200,8 +203,9 @@ JavaScript
Javascript Runtime
-
-
+
+
- Stack
- Contains frames, i.e. function parameters and local variables
@@ -222,7 +226,7 @@ Javascript Runtime
Stack
-
+
- When running a program...
function foo(b) {
@@ -235,7 +239,7 @@ Stack
return foo(x * y)
}
- console.log(bar(7)) //returns 42
+ console.log(bar(7)) //returns 42
- calling
bar
: a frame is created with bar's arguments and variables.
bar
calls foo
: a new frame with foo's args and vars is created.
@@ -249,12 +253,12 @@ Stack
Event Loop
-
while (queue.waitForMessage()) {
queue.processNextMessage()
- }
+ }
- Message = data + callback to be processed
- Messages are process completely one by one
@@ -262,7 +266,7 @@ Event Loop
- No "clashes" across messages' processing
- Processing should not block for a long time – Workers
- - Brwoser adds a new message when an event occurs and there is an event listener
+ - Brwoser adds a new message when an event occurs and there is an event listener
- Run-to-completion
@@ -280,19 +284,20 @@ Event Loop
Handling Request
-
+