LOGIC with JS
Prefer types? See the TS version →
10 lessons with editable examples and exercises. Start with the first.
1What is an algorithm
Turn a problem into clear steps: input, processing and output.2Variables and types
Store values with let and const; recognize numbers, strings and booleans.3Operators and expressions
Calculate, compare values and combine conditions with && and ||.4Decisions
Choose paths with if/else and switch: odd or even and a simple age rule.5Loops: multiplication tables and FizzBuzz
Repeat steps with for and while, then combine decisions in FizzBuzz.6Functions
Separate a task into inputs, processing and a reusable return value.7Arrays: iterate, sum and find the maximum
Use lists, indexes, accumulators and the empty-list edge case.8Objects: a student and grades
Group named properties and combine objects, arrays and functions.9Debugging and edge cases
Read errors, inspect console values and fix an off-by-one loop.10Final project: grade average calculator
Combine decisions, loops, functions, arrays and objects in a testable report.
Turn a problem into clear steps: input, processing and output.2Variables and types
Store values with let and const; recognize numbers, strings and booleans.3Operators and expressions
Calculate, compare values and combine conditions with && and ||.4Decisions
Choose paths with if/else and switch: odd or even and a simple age rule.5Loops: multiplication tables and FizzBuzz
Repeat steps with for and while, then combine decisions in FizzBuzz.6Functions
Separate a task into inputs, processing and a reusable return value.7Arrays: iterate, sum and find the maximum
Use lists, indexes, accumulators and the empty-list edge case.8Objects: a student and grades
Group named properties and combine objects, arrays and functions.9Debugging and edge cases
Read errors, inspect console values and fix an off-by-one loop.10Final project: grade average calculator
Combine decisions, loops, functions, arrays and objects in a testable report.