A collection of beginner-friendly JavaScript exercises to help you practice core concepts and build a strong foundation in programming.
All exercises are tested in Visual Studio Code and can be run using Node.js.
Note: More exercises will be added regularly.
The exercises are organized into folders based on level:
javascript-exercises/
│
├── basic/ # Beginner exercises (current)
├── intermediate/ # Coming soon
└── advanced/ # Coming soon
Each folder contains multiple JavaScript files, each focusing on a specific topic or exercise set.
- Node.js installed on your machine (v14 or above recommended)
- Visual Studio Code recommended, but any code editor can be used
- Check if Node.js is installed
Open the terminal in VS Code and run:node -v
- If you see a version number (e.g., v22.18.0), Node.js is installed.
- If not, install Node.js first.
- Install Node.js (if needed)
- Download and install Node.js from: https://nodejs.org/
- Confirm installation by running node -v again.
- Open the project in VS Code
- Navigate to your project folder and open it in VS Code.
- Open a terminal inside VS Code (Terminal > New Terminal).
- Run an exercise
- In the terminal, run a specific JavaScript file with Node.js:
node basic/exercise_01.js
- Replace the path with file you want to run (e.g., basic/exercise_02.js).
- In the terminal, run a specific JavaScript file with Node.js:
- View the output
- The results will be printed in the terminal.
- Modify the code or try different exercises to practice and experiment in real-time.