In Unit 8, you’ll explore the fundamentals of JavaScript programming — from basic syntax and data types to building interactive browser applications.
Each lesson builds on the previous one, leading up to a complete project: a fully functional Number Guessing Game that combines variables, methods, conditionals, loops, arrays, functions, events, and the Date object.
| Lesson | Topic | Repository |
|---|---|---|
| 8.1 | Variables | 🔗 JS-Variables-and-Methods |
| 8.2 | Methods | 🔗 JS-Variables-and-Methods |
| 8.3 | Selection (Conditionals) | 🔗 JS-Selection |
| 8.4 | Iteration (Loops) | 🔗 JS-Iteration |
| 8.5 | Arrays | 🔗 JS-Arrays |
| 8.6 | Functions | 🔗 JS-Functions |
| 8.7 | Forms & Event Listeners | 🔗 JS-Forms-EventListeners |
| 8.8 | The Date Object | 🔗 JS-Date-Object |
| Project | Final Project: Guessing Game | 🔗 JS-Guessing-Game |
- Writing and using variables, methods, operators, and expressions
- Using conditional statements (
if,else if,else) - Controlling repetition with loops
- Storing and processing data using arrays
- Creating and calling functions with parameters and return values
- Handling user input through forms and event listeners
- Displaying dynamic content on webpages
- Working with JavaScript’s Date object to show and format time
- Integrating all skills into an interactive web application
- Input → Process → Output model in interactive programs
- DOM manipulation using
document.getElementById()andtextContent - Debugging strategies with console logs and incremental testing
- Code organization for readability and modular design
- Real-world problem solving through progressive project development
The unit concludes with the Number Guessing Game Project, where you’ll combine everything you’ve learned:
- Create a user-friendly interface with HTML and CSS
- Use JavaScript to handle events, random numbers, and game logic
- Track statistics like wins, average score, and leaderboard data
- Continuously display the current date and time
All Unit 8 assignments are designed to run seamlessly in GitHub Codespaces.
Follow these steps to open and preview your work:
-
Open the Repository in Codespaces
- Click the green “Code” button on your assignment repository.
- Choose “Open with Codespaces → New codespace.”
- Wait for the environment to build — this may take a minute the first time.
-
Automatic Setup
- All required extensions (like Live Server and Prettier) will install automatically.
- You don’t need to change any configuration files — everything is preloaded for you.
-
Previewing Your Website
- Use the Live Preview tab in Codespaces to open your webpage in a new browser tab.
- If the preview doesn’t load right away, open it once, then click “Open in Browser” again.
- Once it reopens in a browser window, you’ll see your live website running from Codespaces.
-
Tips
- Always make sure your file names match exactly (
index.html,script.js). - Use
console.log()to debug your JavaScript code in the browser console. - Commit and push your changes frequently to save your progress.
- Always make sure your file names match exactly (
After completing Unit 8, you’ll be ready to:
- Design more complex browser-based projects
- Explore object-oriented programming in JavaScript
- Begin building interactive simulations and games
© 2025 CS++