JS FIRST STEPS /// RUN CODE /// HELLO WORLD /// CONSOLE LOG /// JS FIRST STEPS /// RUN CODE /// HELLO WORLD /// CONSOLE LOG /// JS FIRST STEPS /// RUN CODE /// HELLO WORLD /// CONSOLE LOG ///

JavaScript First Steps

It's time to bring the web to life. Learn how to write your first JS instructions, trigger alerts, and print data.

script.js
1 / 12
12345
JS

Tutor:Welcome to JavaScript. Unlike HTML which provides structure, JavaScript provides behavior. It's what makes the web interactive.


Skill Matrix

UNLOCK NODES BY EXECUTING COMMANDS.

Concept: Script Tag

HTML files can run JS. Just place your code inside a <script> tag.

System Check

What HTML element is required to run JavaScript directly in a webpage?


Community Terminal

Showcase Your Scripts

ONLINE

Wrote your first Hello World? Come celebrate your first steps in coding with the community!

JavaScript: First Steps

Author

Pascual Vila

Lead Engineer // Code Syllabus

You've likely structured pages with HTML and styled them with CSS. Now, it's time to add behavior. Welcome to JavaScript, the programming language of the web.

The Script Tag

By default, a browser assumes a file contains HTML. To tell it we are switching to JavaScript, we use the <script> tag. Everything between the opening and closing tag will be interpreted as JavaScript instructions (statements).

Making Noise: alert()

One of the simplest ways to see JavaScript in action is by calling the built-in alert() function. When the browser executes this, it halts the rendering of the page and forces the user to interact with a dialog box. While useful for an absolute beginner test, it is heavily frowned upon in modern web development because it ruins the user experience.

The Developer's Voice: console.log()

So, how do developers test if their code is working without annoying the user? They use console.log(). This command sends text directly to the browser's Developer Tools Console. It's an essential debugging tool that you will use constantly throughout your career.

View Full Transcript+

This section contains the full detailed transcript of the video lessons. It covers the transition from declarative languages (HTML/CSS) to an imperative programming language (JS). It details how JavaScript engines inside browsers parse code line-by-line sequentially, and the historical context of the 'Hello World' tradition in programming.

JS Fundamentals Glossary

Statement

A single line of code or instruction that tells the computer to perform an action. In JS, they typically end with a semicolon (;).

snippet.js

String

A sequence of characters (text) used to represent data. Strings must be enclosed in single ('') or double ("") quotes.

snippet.js

Script Tag

The HTML element `<script>` used to embed or reference executable code, usually JavaScript, within a webpage.

snippet.js

alert()

A built-in browser function that displays a modal dialog with a specified message, requiring the user to click 'OK'.

snippet.js

console.log()

A method that outputs a message to the web console, extremely useful for testing and debugging your code.

snippet.js

Syntax

The set of rules that defines combinations of symbols that are considered to be correctly structured programs in a language.

snippet.js