🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.

Project 28: Dashboard Sidebar

JS Wizard
Step 1 of 2
Project

Tracing Nested Calls

Nest three functions — loadSidebar calls loadUserSection, which calls loadAvatar — and throw an error inside the innermost one. The stack trace this produces lists all three, in order. In production, that trace points at minified, bundled code unless a source map ships alongside it — source maps are what let DevTools show your real function names and line numbers instead.

🎯 Your Task

Please add the exact code shown in the light gray box below to your editor.Do not delete your previous code, just insert these new lines in the correct place!

function loadAvatar() {
  throw new Error("Avatar URL missing");
}

function loadUserSection() {
  loadAvatar();
}

function loadSidebar() {
  loadUserSection();
}

try {
  loadSidebar();
} catch (err) {
  console.log(err.stack);
}