Ready. Start with one instruction.
Loading the learning workspace…
FROM YOUR FIRST INSTRUCTION TO A WORKING APPLICATION
Learn JavaScript from scratch through small working examples, visual experiments and complete projects. No account or AI key required.
Predict → Experiment → Build → Test → Explain
Ready. Start with one instruction.
Loading the learning workspace…
A program is a sequence of instructions. For ordinary synchronous statements, JavaScript finishes one before moving to the next. The order matters: printing a recipe’s last step first changes the story even when every individual instruction is valid. The two console.log calls are separate statements. Read them from top to bottom and predict the two console lines before running. A console records what your code did; it does not choose the order for you.
console.log("First explore.");
console.log("Then build.");First explore. Then build.
Two statements run in source order, so the first message appears above the second.
console.log("First explore.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
console.log("Then build.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
console.log("First predict.");
console.log("Then build.");First predict. Then build.
Two statements run in source order, so the first message appears above the second.
console.log("First predict.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
console.log("Then build.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
console.log("First ask.");
console.log("Then build.");First ask. Then build.
Two statements run in source order, so the first message appears above the second.
console.log("First ask.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
console.log("Then build.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
Repair the intentionally changed operation so the example produces the exact expected result. Then try the extension without copying the answer.
console.log("First explore.");
console.log("Before starting.");console.log("First explore.");
console.log("Then build.");Do not confuse the order of your source lines with a sorted list of messages.
Which operation changed the result, why did it work, and what would you test next?
Use a different value that could expose a boundary or mistake. Predict the result first, run it, and explain how the concept would help in a small real application.
Related: Previous lesson Next lesson
100 lessons across 20 modules, covering variables, operators, strings, conditions, loops, functions, scope, arrays, objects, DOM, events, state, testing, asynchronous JavaScript and application development.