Vocab Flashcards
Namespace
A container for variables and functions.
Typically to keep variables and functions with the same name separate.
Expression
A unit of code that results in a value.
It doesn’t have to save to a variable.
Mutate
To change something
Immutable
It can’t be changed
What is JavaScript?
A single-threaded non-blocking asynchronous concurrent language. Adds interactivity to a webpage.
What is a Call Stack?
One thread–> One Call Stack –> One Thing at a Time.
JavaScript runtime can do ___ thing a time, but the browser can do multiple things at a time.
one
How does the JavaScript Event Loop work?
The event loop is the term given to the process of the waiting for the queue to receive a message synchronously. The increment that the event loop moves in is called a ‘tick’, and every time it ‘ticks’ it checks if the call stack is empty, if so, it adds the top function in the event queue to the call stack and executes it. Once it is finished processing this function it.
What is the call stack?
Every time a function is about to be executed in JavaScript it gets added to the Stack. If that function calls another function within it then that function gets called to the top of the stack.
What is the event queue?
JavaScript runtimes contain a message queue which stores a list of messages to be processed and their associated callback functions.
It stores the order of the functions that they will be executed in and passes them to the call stack as they are requested.
What is v8?
A Google open source javascript and webassembly engine, written in C++. It’s used in chrome and in node.js.
v8 can run standalone or be embedded into any C++ application.
It implements ECMAScript and WebAssembly.