From 182c5d013c8d5ff36782d894cac827c4c59c8554 Mon Sep 17 00:00:00 2001 From: tactonbishop Date: Fri, 15 Jul 2022 08:30:04 +0100 Subject: [PATCH] Last Sync: 2022-07-15 08:30:04 --- .../NodeJS/Modules/{Native => Core}/events.md | 0 .../NodeJS/Modules/{Native => Core}/fs.md | 0 .../NodeJS/Modules/{Native => Core}/http.md | 0 Software_Engineering/Call_stack.md | 29 +++++++++++++++++++ 4 files changed, 29 insertions(+) rename Programming_Languages/NodeJS/Modules/{Native => Core}/events.md (100%) rename Programming_Languages/NodeJS/Modules/{Native => Core}/fs.md (100%) rename Programming_Languages/NodeJS/Modules/{Native => Core}/http.md (100%) create mode 100644 Software_Engineering/Call_stack.md diff --git a/Programming_Languages/NodeJS/Modules/Native/events.md b/Programming_Languages/NodeJS/Modules/Core/events.md similarity index 100% rename from Programming_Languages/NodeJS/Modules/Native/events.md rename to Programming_Languages/NodeJS/Modules/Core/events.md diff --git a/Programming_Languages/NodeJS/Modules/Native/fs.md b/Programming_Languages/NodeJS/Modules/Core/fs.md similarity index 100% rename from Programming_Languages/NodeJS/Modules/Native/fs.md rename to Programming_Languages/NodeJS/Modules/Core/fs.md diff --git a/Programming_Languages/NodeJS/Modules/Native/http.md b/Programming_Languages/NodeJS/Modules/Core/http.md similarity index 100% rename from Programming_Languages/NodeJS/Modules/Native/http.md rename to Programming_Languages/NodeJS/Modules/Core/http.md diff --git a/Software_Engineering/Call_stack.md b/Software_Engineering/Call_stack.md new file mode 100644 index 0000000..e04eeab --- /dev/null +++ b/Software_Engineering/Call_stack.md @@ -0,0 +1,29 @@ +--- +tags: + - Software_Engineering + - call_stack +--- + +# The call-stack + +A [stack](/Data_Structures/Stacks.md) data structure that holds the information of the functions called within a program that allows transfer of the application control from these functions to the main process after code inside the functions has been executed. + +## Example + +```js +function greet(who){ + console.log("Hello " + who); +} + +greet("Harry"); + +console.log("Bye"); +``` +### Breakdown +1. Interpreter receives call to `greet()` +2. Goes to the definition of this function (`function greet(who)...`) +3. Executes the `console.log` within this function +4. Returns to the location that called it (`greet("Harry")`) +5. Finds that there is nothing else to do in this function so moves to next function: the `console.log("bye") +6. Executes +7. Returns to line that called it. Finds nothing else to do. Exits program \ No newline at end of file