LESSON 01 / 07

What JavaScript Is (and Where It Runs)

JavaScript is the language that makes web pages move, react and remember. Meet it, see where it runs, and run your very first line.

๐ŸŽ“Beginnerlevel
โฑ๏ธ25 minto finish
โœ๏ธ3activities

๐Ÿ“‚ First Steps in JavaScript๐Ÿท๏ธ JavaScript basics

๐ŸŽฏ By the end of this lesson you canโ€ฆ

  • Explain what JavaScript does on a web page
  • Name the three languages of the web and their jobs
  • Run a line of JavaScript

The three languages of every web page

LanguageJobExample
HTMLStructure: what is on the pagea button, a heading, a form
CSSStyle: how it looksthe button is purple and round
JavaScriptBehaviour: what happensclicking the button adds an item to your cart

Every time a web page reacts to you โ€” a like counter going up, a menu sliding open, a form saying “that email looks wrong” โ€” JavaScript is running.

Your first line

โšก JavaScript first.js ๐Ÿ‘† Tap a line to explain it
1console.log("Hello, world! ๐ŸŒ");2console.log(2 + 3);

Press โ–ถ Run. Then press โœ๏ธ Edit, change the message to your name and run it again. You are now a JavaScript programmer.

Where JavaScript runs

  • In the browser: every website. Your browser has a JavaScript engine built in (Chromeโ€™s is called V8).
  • On servers and your computer: with Node.js, the same language builds servers, tools and apps.
  • In these lessons: safely inside the page, whenever you press โ–ถ Run.
๐Ÿ’ก Concept check
Which language controls what happens when you click a button?
๐Ÿ”ฎ What will this display?
What does this print?
1console.log(10 - 4);
๐Ÿ› ๏ธ Say hello

Print exactly Hello, LearnWith!

๐Ÿ“Œ Key takeaways

  • HTML = structure, CSS = style, JavaScript = behaviour.
  • JavaScript runs in every browser โ€” and on servers with Node.js.
  • console.log(...) prints a message: your window into the program.

Finished reading & practising?

Saved in this browser. Create a free account to keep it forever.