Print your first message and learn to read your first error.
Talk to the consoleTry itconsole.log(...) prints whatever is inside the brackets. Text goes in quotes.
The missing quoteDebugJavaScript shows an error with a line number when it cannot read your code. Read it: it is a clue.
2. Variables & Types
Give names to values. Text, numbers and yes/no.
Boxes with namesExerciselet makes a variable you can change. Give variables clear names, like score and not x.
Kinds of valuesExerciseStrings need quotes, numbers do not, and true/false are their own type. "42" in quotes is text, not a number.
Mixing values into textExerciseTemplate literals are the easy way to build sentences from values. Change age and the sentence updates.
The value that will not changeDebugconst for values that never change, let for values that do. The error told you exactly what happened.
Quick checkQuizName a value, know its type, and put it in a sentence: you can now store and show information.
3. Decisions
Make your code choose with if and else.
Yes or no questionsExerciseComparisons produce booleans. Use === to test equality: a single = means something else.
If this, then thatExerciseif and else let a program react differently to different data. That is what makes programs feel smart.
Two conditions at onceExercise&& needs both, || needs one. Try setting hasTicket to false and see what happens.
The door that always opensDebug= puts a value in, === asks a question. Inside an if, you almost always want ===.
Quick checkQuizComparison + if/else + &&/||: the toolbox of every decision in code.
4. Functions
Package code into reusable tools.
Your first functionExerciseFunctions are how you avoid repeating yourself. Define once, call as often as you like.
Inputs and outputsExerciseParameters go in, return sends the result out. The caller can print it, store it or use it in more math.
Arrow functionsExerciseArrow functions are everywhere in modern code, especially for short helpers.
The function that gives nothing backDebugIf a function prints undefined, check that it uses return.
Quick checkQuizDefine, give inputs, return a result. Functions are the building blocks of every program.
5. Arrays, Loops & Objects
Handle lists of things without repeating yourself.
A list of thingsExerciseArrays hold lists. push adds, length counts, and array[0] reads the first item. You can change a const array with push, because the array itself stays the same.
Repeat without repeatingExerciseA for loop has three parts: where to start, when to stop, and how to step. Change 5 to 1000 and it still works.
Transform and filterExercisemap transforms, filter selects, and both leave the original array untouched. You can chain them.
Things with propertiesExerciseArrays are for lists, objects are for describing one thing. Real data is often an array of objects.
One step too farDebugFor arrays, the loop pattern is for (let i = 0; i < array.length; i++). Memorize it.
Quick checkQuizArrays, loops and objects are how programs deal with real data.
6. The DOM
Reach into the page and change it from JavaScript.
Reach into the pageExerciseFind an element, then change its properties. Almost everything interactive works this way.
Change how it looksExerciseelement.style.property = value changes the look. For bigger changes, it is neater to switch a CSS class instead.
Make new elementsExerciseCreate, fill, append. This is how apps show lists of messages, products and search results.
Quick checkQuizFind, change, create: the three moves of DOM programming.
7. Events
React to clicks, typing and key presses.
React to a clickExerciseEvents are how pages become interactive: something happens, your function runs.
React to typingExerciseinput.value always holds the current text. Events plus the DOM give you live interfaces.
The button that was not foundDebugWhen you see an error about null, check your selector against the HTML first.
Quick checkQuizListen for an event, run a function, change the page. That loop powers every web app.
8. Final Project
Build a real interactive app. A to-do list or a color palette maker.
Stage 1: add tasksExerciseEvent + read input + create element + append: the core of most interactive pages.
Stage 2: tidy upExerciseAlways think about what users might do: empty input, extra spaces. return exits a function early.
Stage 3: mark as doneExerciseVariables, decisions, functions, arrays of things, the DOM and events: all in one small app. Next idea: save the tasks with localStorage.
9. JavaScript exam
Ten questions about everything in this course. Pass with 8 right answers.
The JavaScript examExamVariables, types, decisions, functions, arrays, loops, the DOM and events: you can make pages come alive.
10. Final project
Bring a shopping-list app to life with JavaScript, add your own touch, and send it for review.
A shopping list that worksFinal projectSelecting elements, listening to events, creating elements and keeping the page in sync: real front-end development.
How the course works
You learn by doing: each lesson explains one idea, then you write real code in the editor and see the result right away. The first lesson is free to try without an account; sign up to save your progress and continue.
Try it
Change working code and see the result immediately.
Exercise
Complete a task. A checklist confirms each requirement as you type.
Debug
Fix code that is broken on purpose, and learn why it failed.