Introduction to JavaScript
JavaScript is the programming language that runs inside web browsers (and, with tools like Node.js, outside them too). While HTML structures a page and CSS styles it, JavaScript makes it interactive: it can respond to a button click, check what a user typed, change content on the fly, or talk to a server. You add JavaScript to a page with a <script> tag. Code written between <script> and </script> runs in order, top to bottom, as soon as the browser reaches it. console.log() is one of the first tools you'll use constantly it prints a value to the browser's developer console, which is invaluable for checking what your code is actually doing while you're learning or debugging. Unlike HTML, JavaScript is case-sensitive and has real logic: it can make decisions, repeat actions, and calculate values. That's the whole subject of this course.
Why this matters
- ·JavaScript turns a static page into something that can react and respond.
- ·It runs directly in the browser, no extra installation needed to get started.
- ·console.log makes it easy to see exactly what your code is doing while you learn.
Common mistakes
- ·JavaScript is case-sensitive myVar and myvar are two completely different names.
- ·A single typo or missing bracket can stop an entire script from running.
- ·Code runs top to bottom, so using something before it's defined further down can cause errors.
Frequently asked questions
Mainly inside web browsers, but tools like Node.js let it run on servers and computers too.
Practice questions
Question 1
Log the text "I'm learning JavaScript" to the console.
Question 2
Change the page's body content to show your name in an <h1>.
Quick check
Just for this topic answer honestly, then check yourself.
1 / 3
