Method 1: Using Visual Studio Code Built-in Terminal
To install Visual Studio Code, go to this download page and choose the appropriate operating system.
How to install Nodejs
- Go to nodejs.org
- Download The latest version, It is Recommended For Most Users
This video will show you how to install Nodejs on your computer.
Create a foalder and open it with Vs Code, and then Open the Built-in Terminal
Next type this command in the terminal and click enter,
Method 2: Using the "Code Runner" Extension
How to install the Code Runner Extension
- Go to the Extensions tab in VS Code
- Search for "Code Runner"
- Then Install it
How to use the Extension
- Add Breakpoints: Click on the left margin of your code to add breakpoints. Breakpoints allow you to pause the execution of your code at specific lines for inspection.
- Run in Debug Mode: To run your code in debug mode, press F5 or click the green "Run and Debug" arrow in the left sidebar.
- Debugging Controls: You can use the debugging controls, such as stepping through the code, inspecting variables, and more.
- View Debug Output: The debugging console at the bottom of VS Code allows you to see the output of console.log statements and error messages.
To learn more about debugging check this video
I hope this post has helped you to achieve your goals, Keep on coding.