This simple guide will walk you through how to set up your development environment, to make working with JavaScript smooth and interactive. The setup will use a simple folder structure with an HTML document and an external JavaScript file. This way, you can code along with the guide, write JavaScript in a separate file, and see your output in the browser console. This setup is pretty much how things work in the real world of web development. Let's dive in!
Using an external JavaScript file has several advantages:
Start by creating a new folder on your computer where you'll store your project files. Name the folder something like js-tutorial.
Inside your project folder (js-tutorial), create a new HTML file. Name it something like index.html.
Still inside your project folder (js-tutorial), create a new JavaScript file. Name it something like script.js.
Open your index.html file in a text editor and set up a basic HTML structure. Link the external JavaScript file using the