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