A frontend debugging portfolio project showing common JavaScript bugs, corrected versions, tests, and a small browser demo.
This repo is designed to show practical beginner-to-intermediate debugging ability for JavaScript, HTML/CSS, DOM behavior, forms, simple UI logic, and async error handling.
The goal of this project is to demonstrate the kind of help many coding clients need:
- Finding why a button, form, counter, dropdown, or list is not working
- Explaining the bug in plain language
- Fixing the code without overcomplicating it
- Testing edge cases
- Making the frontend behavior easier to understand
This supports a practical coding-help profile focused on debugging, code review, and small web app prototypes.
- JavaScript
- HTML
- CSS
- Node.js
- Built-in Node
asserttests
No external dependencies are required.
This repo includes seven debugging examples:
- Button click event handling bug
- Form validation bug
- Counter type-conversion bug
- Dropdown class-name bug
- Completed task filtering bug
- User list HTML rendering bug
- Async fetch error-handling bug
Each example includes:
- A broken version
- A fixed version
- A plain-English explanation
- Tests for the fixed behavior
- A small demo page for the UI examples
javascript-bug-fix-lab/
│
├── css/
│ └── styles.css
├── examples/
│ └── run_examples.js
├── js/
│ ├── broken_examples.js
│ ├── browser_bundle.js
│ ├── dom_demo.js
│ └── fixed_examples.js
├── tests/
│ └── fixed_examples.test.js
├── .gitignore
├── BUG_EXPLANATIONS.md
├── index.html
├── package.json
└── README.md
Make sure Node.js is installed, then run:
npm testExpected result:
All fixed JavaScript example tests passed.
npm run demoThis prints simple before/after-style examples to the terminal.
Open this file in a browser:
index.html
The page includes small demos for:
- Button click handling
- Form validation
- Counter updates
- Dropdown toggling
- Completed task filtering
Broken counter-style logic:
return currentValue + 1;If currentValue comes from the DOM as a string, this can produce:
"5" + 1 = "51"
Fixed logic:
const numericValue = Number(currentValue);
const safeValue = Number.isFinite(numericValue) ? numericValue : 0;
return safeValue + 1;This produces the expected number:
5 + 1 = 6
This project demonstrates that I can:
- Debug common JavaScript logic problems
- Explain why frontend code fails
- Fix DOM-related behavior clearly
- Handle edge cases
- Write simple tests for corrected code
- Build a small browser demo using HTML, CSS, and JavaScript
The focus is not on advanced frameworks. The focus is practical debugging and clear explanations for real beginner-to-intermediate coding problems.