Skip to content
beginner

Functions and Events

Learn how to organize code with functions and respond to user actions with events.

Tutorials

Articles in Functions and Events

Follow these lessons in order, or jump directly to the topic you need.

A vibrant green forest with tall trees and sunlit canopy, showcasing nature's beauty.
beginner
7 min read

Introduction to Functions

Copying and pasting the same code over and over works for a while—until you need to change something and suddenly have to hunt through ten copies of the…

Read tutorial
A breathtaking view of a tropical sunset with vibrant colors reflecting on the calm sea.
beginner
7 min read

Arrow Functions Basics

JavaScript arrow functions let you write the same functions you already know in fewer lines. The idea isn't new—only the syntax is shorter.

Read tutorial
A busy urban street scene in Rome, Italy, showcasing iconic historic architecture and vibrant city life.
beginner
7 min read

Handling Click Events

You have a button on your page. You want something to happen when someone clicks it. That moment—when a static page starts responding—is where JavaScript…

Read tutorial
Monochrome photograph of a bearded dragon lizard's detailed head with spiked scales.
beginner
8 min read

Keyboard and Form Events

A button click is one quick signal. Typing is a stream of signals. Every search box, sign-up form, and chat input depends on JavaScript watching that…

Read tutorial