← All languages
JavaScript programs
console.log, then the programs you actually ship.
14 topics · 124 examples · ordered like a syllabus
Open Hello WorldTopics, in order
Finish one. The next is the card below.
- 01JavaScript Basic ProgramsStart here with simple JavaScript programs. Print text, add numbers, swap values and convert units. Each page explains the code line by line and shows the output.
- Hello World
- Display Your Name
- User Input
- 02JavaScript Conditional ProgramsLearn how JavaScript makes decisions with if, else and switch. Check even or odd numbers, leap years, grades and more, with clear output for each program.
- Check Even or Odd
- Largest Among Three Numbers
- Vowel/Consonant Check
- 03JavaScript Loop ProgramsPractice JavaScript loops like for and while. Build tables, factorials, Fibonacci series, prime checks and number patterns, with step-by-step help and output.
- Multiplication Table
- Sum of n Natural Numbers
- Factorial of a Number
- 04JavaScript Array ProgramsWork with lists of values in JavaScript. Find the largest item, sort, search, remove duplicates and use map, filter and reduce, with simple examples and output.
- Array Max & Min
- Array Average
- Sum of Array Elements
- 05JavaScript String ProgramsHandle text in JavaScript. Reverse strings, count vowels and words, change case and check palindromes, with every line of code explained and its output shown.
- String Length
- Reverse a String
- String Palindrome Check
- 06JavaScript Function ProgramsUnderstand JavaScript functions: arrow functions, callbacks, closures and default values. Short programs show how each idea works and what it prints.
- Basic Functions
- Callback Functions
- Closures
- 07JavaScript Object ProgramsStore and use data with JavaScript objects. Create objects, read and change keys, loop over them, copy them and merge them, with clear output for each step.
- Object Basics
- Classes (ES6)
- 08JavaScript Events ProgramsMake web pages respond to people with JavaScript events. Handle clicks, typing, forms, mouse moves, drag and drop and custom events, with expected output.
- DOM Events Basics
- Custom Events
- Event Bubbling and Capturing
- 09JavaScript LocalStorage and SessionStorageSave data in the browser with JavaScript localStorage and sessionStorage. Store objects as JSON, set expiry times, sync tabs and handle storage limits.
- LocalStorage Basics
- SessionStorage Basics
- Storage Event Listener
- 10JavaScript Date and Time ProgramsWork with dates and times in JavaScript. Get the current time, format dates, add days, compare dates, build timers and handle time zones, with sample output.
- Get Current Date and Time
- Format Date and Time
- Date Arithmetic
- 11JavaScript Error HandlingHandle problems safely in JavaScript. Use try, catch and finally, custom errors, async errors, retries, logging and recovery, with real output for each program.
- Try-Catch-Finally
- Custom Errors
- Error Propagation
- 12JavaScript Browser APIsPractise JavaScript Browser APIs with runnable examples for location, files, storage, drawing, and device features. Learn permissions, output, and common mistakes.
- Geolocation API
- Notifications API
- Clipboard API
- 13JavaScript Mini ProjectsBuild JavaScript Mini Projects with simple code, clear steps, and visible results. Practise forms, games, timers, lists, and small apps with common mistakes explained.
- Todo List
- Calculator
- Stopwatch with Start, Stop and Reset
- 14Advanced JavaScriptLearn Advanced JavaScript with small working examples of prototypes, closures, generators, proxies, workers, and the event loop. Follow each result step by step.
- Prototypes
- Inheritance
- Closures Advanced