Lifecycle Stages
Real-World Scenarios
Error Types
Debugging Tools
Fix That Bug
100

Stage where you gather requirements and define what the app should do.

Planning

100

Your client explains what features they want in their new website. What stage is this?

Planning

100

Error type that happens while the program is running and causes it to crash.

Runtime error

100

Simple JavaScript method used to print values to the browser console.

console.log()

100

const num = prompt("Enter a number:");

alert("Your number doubled is " + num * 2);

The alert shows unexpected results for some inputs. What’s the fix?

Convert input to a number, e.g. Number(num) or parseInt(num)

200

Stage where you decide UI layout, data flow, and technology stack.

Design

200

You sketch wireframes and choose color schemes. What stage are you in?

Design

200

Error where the code runs without crashing but produces the wrong result.

Logic error

200

Browser feature used to pause code on a specific line.

Breakpoint

200

let count = 0;

consol.log(count);

Why does this fail?

console is misspelled as consol

300

Stage where the team actually writes the HTML, CSS, and JavaScript.

Development / Implementation

300

You upload your finished app to a web server and make it public. What stage is this?

Deployment

300

User types letters into a numeric-only field, causing problems. What kind of error is this?

Input validation error

300

Name of the panel in browser DevTools where you can step through JavaScript.

Sources / Debugger panel

300

if (score = 100) {

  alert("Perfect!");

}

What is the logic bug?

Uses assignment = instead of comparison == or ===

400

Stage focused on checking for bugs and verifying the app meets requirements.

Testing

400

Users start reporting bugs after launch. Which stage handles that?

Maintenance

400

You forget a closing parenthesis and the script won’t run at all. What kind of error is this?

Syntax error

400

What is the main advantage of using breakpoints instead of only console.log()?

You can pause execution and inspect variables and call stack at specific points.

400

let total;

console.log(total + 5);

The console shows NaN. Why?

total is undefined before being given a numeric value

500

Stage where the app is in use, and you fix bugs and add improvements over time.

Maintenance

500

You run user tests and adjust the app based on their feedback. Which two stages are you bouncing between?

Testing and Maintenance (or Testing and Development)

500

You validate input on the client side only and users bypass it. What kind of weakness is this?

Poor or incomplete validation / relying only on client-side validation

500

Which DevTools feature lets you monitor the value of an expression as code runs (without editing code)?

Watch expressions / Watch panel

500

function add(a, b) {

  return a + b;

}

console.log(add(2));

What’s wrong and how do you avoid it?

Only one argument is passed, b is undefined. Ensure both parameters are provided or set a default value.

M
e
n
u