This file demonstrates how the JavaScript learning and testing system works.
✅ Complete JavaScript Learning Platform
- 3 comprehensive exercises covering core fundamentals
- Automated testing with detailed feedback
- Progressive difficulty from beginner to intermediate
- Professional development workflow
javascript-fundamentals-course/
├── package.json # Project configuration
├── README.md # Main course documentation
├── setup-instructions.md # Detailed setup guide
├── DEMO.md # This demonstration file
├── tests/
│ └── test-runner.js # Centralized test runner
└── exercises/
├── 01-variables/ # Variables and data types
│ ├── README.md # Exercise instructions
│ ├── exercise.js # Student template
│ ├── test.js # Automated tests
│ └── solution.js # Complete solution
├── 02-functions/ # Functions and scope
│ ├── README.md
│ ├── exercise.js
│ ├── test.js
│ └── solution.js
└── 05-arrays/ # Array manipulation
├── README.md
├── exercise.js
├── test.js
└── solution.js
Exercise 1: Variables and Data Types
- Variable declarations (let, const, var)
- Data types (string, number, boolean, object)
- Basic operations and string manipulation
Exercise 2: Functions
- Function declarations and expressions
- Arrow functions and syntax variations
- Parameters, default values, and return statements
- Closures and higher-order functions
- Callback functions
Exercise 5: Arrays
- Array creation and manipulation
- Array methods (push, pop, filter, map, reduce)
- Finding elements and calculating values
- Immutable operations
-
Start an Exercise
cd exercises/01-variables # Read README.md for instructions # Edit exercise.js to complete functions
-
Test Your Work
node test.js
-
See Results
- ✅ Green = Success, move to next exercise
- ❌ Red = Fix errors and try again
-
Run All Tests
npm test -
Check Individual Exercise
npm run test:exercise 01-variables
-
Review Solutions
- Each exercise has a complete
solution.jsfile - Multiple approaches shown for teaching
- Each exercise has a complete
Testing Exercise 1: Variables and Data Types
==================================================
❌ Task 1: createPersonInfo()
Error: Should return an object
❌ Task 2: calculateAge()
Error: calculateAge(1990) should return 34
...
Passed: 0/6
⚠️ 6 test(s) failed. Keep working on it!
Testing Exercise 1: Variables and Data Types
==================================================
✅ Task 1: createPersonInfo()
✅ Task 2: calculateAge()
✅ Task 3: formatFullName()
✅ Task 4: checkAdult()
✅ Task 5: convertTemperature()
✅ Task 6: createGreeting()
Passed: 6/6
🎉 All tests passed! Great work!
- Students write code in separate files
- Run tests via command line (npm/node)
- Immediate feedback with detailed error messages
- Mimics real-world development practices
- Clear learning objectives for each exercise
- Step-by-step instructions with examples
- Progressive difficulty building on previous concepts
- Multiple solution approaches for deeper understanding
- Comprehensive test suites with edge cases
- Clear pass/fail indicators
- Detailed error messages guide learning
- Easy progress tracking for instructors
- Easy to add new exercises
- Consistent structure across all modules
- Customizable difficulty levels
- Ready for classroom or self-study use
- Prerequisites: Node.js (v14+), code editor
- Setup: Download/clone the repository
- Start Learning: Begin with
exercises/01-variables/ - Get Help: Refer to
setup-instructions.md
- Coding Bootcamps: Structured curriculum with automated grading
- Computer Science Courses: Hands-on JavaScript fundamentals
- Self-Study: Clear progression with immediate feedback
- Tutoring: Ready-made exercises with solutions
Ready to start learning JavaScript? Begin with Exercise 1! 🚀