Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 692 Bytes

File metadata and controls

50 lines (31 loc) · 692 Bytes
  1. A nested function that prints a stack trace error to the console

function firstFunction(){
throw new Error('Stack Trace Error');
}

function secondFunction(){
firstFunction();
}

function thirdFunction(){
secondFunction();
}

thirdFunction();


  1. A function that calls another function to show how the stack handles multiple function calls.

function firstFunction(){
 console.log("Hello from firstFunction");
}

function secondFunction(){
 firstFunction();
 console.log("The end from secondFunction");
}

secondFunction();

  1. A recursive function that will throw a maxiumu call stack error.
function callMyself(){
  callMyself();
}

callMyself();