← All languages

JavaScript programs

console.log, then the programs you actually ship.

14 topics · 124 examples · ordered like a syllabus

Open Hello World

Topics, in order

Finish one. The next is the card below.

  1. 01Basic Programsconsole.log, let, a bit of math. Week-one JS. If this feels slow, skip ahead.
    • Hello World
    • Display Your Name
    • User Input
    10 programs →
  2. 02Conditional Programsif / else / switch. Grades, vowels, leap years. === not ==.
    • Check Even or Odd
    • Largest Among Three Numbers
    • Vowel/Consonant Check
    5 programs →
  3. 03Loop Programsfor, while, for...of. Tables, factorials, primes. You will get tired of i++.
    • Multiplication Table
    • Sum of n Natural Numbers
    • Factorial of a Number
    6 programs →
  4. 04Array Programsmap, filter, reduce, indexOf. Most interview warm-ups are this file.
    • Array Max & Min
    • Array Average
    • Sum of Array Elements
    6 programs →
  5. 05String Programslength, reverse, palindrome, split. Strings are where beginners leak hours.
    • String Length
    • Reverse a String
    • String Palindrome Check
    5 programs →
  6. 06Function Programsdeclarations, arrows, callbacks, closures. Closures are just a function that kept its bag.
    • Basic Functions
    • Callback Functions
    • Closures
    3 programs →
  7. 07Object Programsobjects, then classes. this is the part people Google at 1am.
    • Object Basics
    • Classes (ES6)
    2 programs →
  8. 08Events Programsclick, submit, bubbling. addEventListener. Not onclick= in the HTML.
    • DOM Events Basics
    • Custom Events
    • Event Bubbling and Capturing
    10 programs →
  9. 09LocalStorage/SessionStoragelocalStorage survives a refresh. sessionStorage dies with the tab. JSON.parse the strings.
    • LocalStorage Basics
    • SessionStorage Basics
    • Storage Event Listener
    10 programs →
  10. 10Date/Time ProgramsDate is a mess. Month is 0-indexed. That bug ships.
    • Get Current Date and Time
    • Format Date and Time
    • Date Arithmetic
    10 programs →
  11. 11Error Handlingtry / catch / finally. Throw real Error objects, not strings.
    • Try-Catch-Finally
    • Custom Errors
    • Error Propagation
    10 programs →
  12. 12Browser APIgeolocation, clipboard, workers. The browser says no until you ask.
    • Geolocation API
    • Notifications API
    • Clipboard API
    15 programs →
  13. 13Mini Projectssmall apps, one idea each. Steal the pattern, not the CSS.
    • Todo List
    • Calculator
    • Stopwatch
    20 programs →
  14. 14Advanced JSprototypes, proxies, the event loop. Read this after the rest stops feeling weird.
    • Prototypes
    • Inheritance
    • Closures Advanced
    12 programs →