JavaScript · Foundations

Learn JavaScript

The syntax and the mental model. Short, runnable, no fluff.

Learn the Basics

01

Hello, World!

Welcome to the first tutorial. In this tutorial you will learn how to write your first line of code. JavaScript is a very powerful language.

02

Variables and Types

JavaScript is dynamically typed, so a variable can hold any value. Declare with const by default, let when you need to reassign.

03

Arrays

JavaScript can hold an array of variables in an Array object. In JavaScript, an array also functions as a list, a stack or a queue.

04

Manipulating Arrays

Arrays can also function as a stack. The push and pop methods insert and remove variables from the end of an array.

05

Operators

Every variable in JavaScript is casted automatically so any operator between two variables will always give some kind of result.

06

Conditions

The if statement allows us to check if an expression is equal to true or false, and execute different code according to the result.

07

Loops

JavaScript has two methods for running the same code several times. It is mainly used for iterating over arrays or objects.

08

Objects

JavaScript is a functional language, and for object oriented programming it uses both objects and functions, but objects are usually used as a data structure, similar to a dictionary in Python or a map in Java.

09

Functions

Functions are code blocks that can have arguments, and function have their own scope.

10

Pop-up Boxes

There are three types of pop-up boxes in javascript: confirm, alert, and prompt.

11

Callbacks

Callbacks in JavaScript are functions that are passed as arguments to other functions.

12

Arrow Functions

Arrow functions are a feature of ES6, their behavior are generally the same of a function.

Advanced Tutorials

Machine Learning in the Browser

Get the JavaScript agent pack

A battle-tested AGENTS.md, the review checklist, and the failure-mode cheat sheet for JavaScript. One email, then occasional updates when the tooling shifts. No course pitch.

Unsubscribe in one click. We never sell the list. Or just take the AGENTS.md now — no email needed.