Tutorials

Learn. Code. Build.

Practical programming tutorials to improve your development skills.

Explore Tutorials

loop.js
const list = document
  .querySelectorAll("button");

list.forEach((button, index) => {
  button.addEventListener("click", () => {
    console.log(index);
  });
});

03 / Tutorials

Latest tutorials

All opening tutorials

04 / Daily challenge

One question for today

Scores, badges, and a leaderboard come later. This one you can check now.

What does this print?

const numbers = [1, 2, 3];
numbers[10] = 4;
console.log(numbers.length);
Choose a length

05 / Code of the day

Guard a JSON parse

Return a fallback when the payload is missing or malformed, and keep the original error attached.

JavaScript
function readJson(value, fallback) {
  if (typeof value !== "string" || value.trim() === "") {
    return fallback;
  }
  try {
    return JSON.parse(value);
  } catch (error) {
    console.warn("Invalid JSON", error);
    return fallback;
  }
}

06 / Developer tools

Utilities for the next build

Each of these will run in the browser: an input, an output, and buttons to process, copy, and clear. They are listed here so the homepage shows the full set. They do not run yet.

JSON Formatter

Pretty-print a payload and spot a missing comma.

JSON Validator

Check that a string is valid JSON before you ship it.

Base64 Encoder

Encode a string without leaving the page.

Base64 Decoder

Turn a token or payload back into text.

URL Encoder

Escape a query so spaces and symbols survive.

URL Decoder

Read a query string as plain text.

UUID Generator

Mint an identifier for a record or a test.

Regex Tester

Try a pattern against a sample, and see the matches.

SQL Formatter

Break a one-line query into something you can read.

HTML Formatter

Indent a fragment so the structure shows.

CSS Formatter

Untangle a minified stylesheet.

JavaScript Formatter

Restore line breaks in a minified script.

07 / AI assistant

Ask, explain, debug, convert

The assistant will take a question or a broken snippet and answer from a server route, so the API key never ships to the browser. It is not connected on this build.

  • Ask a programming question
  • Explain an error message
  • Generate or debug a snippet
  • Optimize a hot path
  • Convert code between languages
  • Explain a concept in plain language

08 / Notes

Latest from the desk

09 / Community

Questions, answers, and votes

Accounts, threads, and upvotes are a later phase. The room is reserved for three kinds of posts.

The error, quoted

Paste the message and the frame in your own code. That is the post.

Two fixes, compared

Show the version that failed and the version that held, and say what changed.

What you already tried

A list of attempts keeps the answers from repeating the first search result.