Beginner-friendly JavaScript textbook with exercises and automated tests.
- Node.js (version 14 or higher)
- A code editor (VS Code recommended)
- Open a terminal/command prompt
- Navigate to where you want the project (e.g., your Desktop or Documents folder):
cd Desktop
- Clone the repository (this creates a
js-kickstart
folder automatically):git clone https://github.com/r-/js-kickstart.git
- Enter the project folder:
cd js-kickstart
- Install dependencies:
npm install
- Click the green "Code" button on GitHub
- Select "Download ZIP"
- Extract the ZIP file to your desired location
- Open a terminal in the extracted folder
- Install dependencies:
npm install
IMPORTANT: Always run commands from the main project folder (where package.json is located), not from inside exercise folders!
- Navigate to an exercise folder (e.g.,
exercises/02-sequence/03-day-plan/
) - Edit the
script.js
file in that folder - Test your script by running it directly:
node exercises/02-sequence/03-day-plan/script.js
- When ready, test your solution with the automated tests:
npm test
To run tests for a specific exercise (run from main project folder):
npm run test:one -- 02-sequence
- Read the exercise instructions in the exercise folder's README.md
- Edit the
script.js
file in that exercise folder - Run your script directly:
node exercises/[chapter]/[exercise]/script.js
- Test with automated tests:
npm test
ornpm run test:one -- [chapter]
- Check the
solution.js
file if you get stuck (for teachers and reference)
Some exercises require user input. For these:
- Install the prompt library (one time only):
npm run setup:prompt
- Follow the exercise instructions
- Intro & Setup - Getting started with Node.js and VS Code
- Sequence - Step-by-step programming
- Variables & Datatypes - Storing and using data
- Operators - Arithmetic, comparison, and logic
- Input & Output - Interacting with users
- Selections - Making decisions with
if
statements - Iterations - Repeating code with loops
- Functions - Organizing code into reusable blocks
- Arrays - Working with lists of data
- Mini Project - Putting it all together
- Each chapter contains 3-5 practical exercises
- Every exercise has automated tests for instant feedback
- Early chapters use simple scripts, later chapters introduce functions
- Run all tests:
npm test
- Run specific test:
npm run test:one -- <exercise-path>
These commands test your script.js
files to check your progress.
- Test all solutions:
npm run test:solutions
- Test specific solution:
npm run test:solutions:one -- <exercise-path>
These commands test the reference solution.js
files for validation.
By completing this course, you will understand:
- Basic programming concepts (sequence, selection, iteration)
- JavaScript syntax and best practices
- How to write and test code
- Problem-solving through programming
- Read the chapter material in
book/chapters/
- Practice with exercises in
exercises/
- Test your solutions with
npm test
- Reflect on what you've learned
- Check the exercise README for specific instructions
- Review the chapter material for concepts
- Look at error messages from tests for hints
- Ask your teacher or study group for support
- Ask questions on GitHub: Create an issue for help with exercises or technical problems
Want to save your progress and work on exercises from different computers? Learn how to use GitHub to sync your work:
👉 Complete Guide: Using GitHub for Your Exercises
This guide covers:
- Forking the repository to your own GitHub account
- Saving your exercise solutions
- Syncing work between home, school, and library computers
- Getting updates when new exercises are added
We welcome contributions! Whether you want to:
- Report a bug or typo
- Suggest improvements to exercises
- Add new learning materials
- Fix documentation
Please see our Contributing Guide for detailed instructions on how to get involved.
MIT License - feel free to use and adapt for educational purposes.
Happy coding! 🎉
JavaScript is a trademark of Oracle Corporation. This project is not affiliated with or endorsed by Oracle.