a function being invoked
single-threaded engine means only one at a time
Last In, First Out
function a() { b();}
function b() { c();}
function c() { // Some code here }
a(); // Start here
output: ``` c() <- Top of the stack (currently executing) b() <- Called by ‘a’ a() <- Called first, at the bottom of the stack ———– main() <- Main entry point of the program ```
when too many calls get made to the stack (typically recursion or other runaway functions)
A “Reference Error” is thrown in JavaScript when you try to use a variable that has not been declared. It means that the referred variable is not in scope at the point in the code where it’s being referenced.
A “Syntax Error” occurs when the structure of the code violates the grammatical rules of the programming language. In JavaScript, this could be a missing parenthesis, bracket, or misuse of an operator, leading to code that the interpreter cannot understand.
A “Range Error” is thrown when a value is outside the set or allowable range of values as defined by the operation or the array. For example, in JavaScript, this error can occur when you try to create an array with a negative length.
A “Type Error” is thrown when an operation is performed on a value of an unexpected type. For example, trying to call something that is not a function or accessing a property on
undefined
ornull
in JavaScript will result in a type error.
A “breakpoint” is a debugging tool used in many development environments. It’s a mark in the code where the execution will be paused when debugging. This allows developers to inspect the current state of the program at that specific point in the execution flow.
The
debugger
keyword in JavaScript is used to pause the execution of code and initiate debugging mode if the debugging tool is available. When the JavaScript engine encounters thedebugger
statement, it stops execution at that point, allowing developers to step through the code and inspect variables, call stack, and other details within the debugging tool.