DEV Community

Cover image for Where to write and execute JavaScript code? πŸ‘©πŸ»β€πŸ’»
TechWorld with Nana
TechWorld with Nana

Posted on

39 3

Where to write and execute JavaScript code? πŸ‘©πŸ»β€πŸ’»

In this new video 🎬 I explain and show the 3 ways of how to write and execute your JavaScript code.

πŸ‘©πŸ»β€πŸ’» Where to write and execute JavaScript

  1. Writing and executing JavaScript directly in the Browser Console is the simplest way to get started. It's practical when you want to try something out, but not an option for real programming. Find out why in the video.
  2. The second option writing JavaScript code in the index.html file (called inline script) is better, but has some disadvantages in structuring and keeping HTML/CSS apart from your logic.
  3. The third and last way to write JavaScript code, is writing the code in a separate JavaScript file and linking this file in the HTML file. This is the way to go, because it is clean and practical when your application gets bigger.

πŸ‘©πŸ»β€πŸ’» Simple Text Editor vs. Special Code Editor
I also explain and show you the advantages of writing your JavaScript code in a special code editor instead of writing it in a simple text editor. One example is the highlighting of keywords or syntax error detection, which helps a lot in programming! πŸ’―

πŸ‘©πŸ»β€πŸ’» Finally, understanding how files in real projects are structured and referenced will help you a lot when getting started.

Really understanding the above topics, will help you a lot when starting coding. πŸ™‚


βœ… I will upload a complete JavaScript Tutorial for absolute beginners. So if you are completely new to programming this will give you a step by step guide to learn JavaScript. You can subscribe on Youtube to get notified πŸ™‚ βœ…

I'm happy to connect with you on

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

πŸ‘₯ Ideal for solo developers, teams, and cross-company projects

Learn more