Setting Up Your Development Environment
Before you start writing JavaScript code, you need the right tools to make the process smooth and enjoyable. Just like an artist needs brushes and paint, a developer needs a code editor and a browser. In this lesson, you'll learn how to set up your environment so you can easily write, test, and explore JavaScript.
Choosing a code editor (VS Code)
A code editor is where you'll write your JavaScript. One of the most popular and beginner-friendly editors is Visual Studio Code (VS Code). It’s free, fast, and packed with features that help you write better code—like syntax highlighting, auto-complete, and extensions for almost everything.
You can download it from [https://code.visualstudio.com](https://code.visualstudio.com). Once installed, you’re ready to start coding in JavaScript right away.
Installing browser extensions (optional)
While not required, there are a few browser extensions that can help with learning and debugging JavaScript. Extensions like Live Server (for running HTML files quickly) or JavaScript Console Enhancer (for better logging) are handy tools to try out. These can improve your workflow, especially when you're building small projects or testing code.
Intro to browser DevTools
Every modern browser (like Chrome, Firefox, or Edge) comes with built-in Developer Tools. These tools let you inspect websites, see how they work, and debug your code. You can open DevTools by right-clicking any page and selecting “Inspect” or by pressing F12
.
Inside DevTools, the Console tab is where you’ll be spending a lot of time when learning JavaScript. It shows errors, messages, and lets you run code live.
Writing JS directly in browser console
To start learning quickly, you can write JavaScript directly in the browser console. Just open DevTools, go to the Console tab, and type something like:
console.log("Hello, JavaScript!");
You’ll instantly see the result printed in the console. This is a great way to try out small snippets of code without needing any setup or files. It's perfect for experimenting and understanding how different parts of JavaScript work.