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…
Syntax is the arrangement of symbols that makes a program valid. Quotation marks surround text, parentheses contain arguments, and semicolons end these statements. A comment starts with two slashes and explains the source to a human; JavaScript ignores it. Comments should explain intent rather than describe an unrelated outcome. Try changing the comment and then changing the message. Only the second edit changes the console result.
// This comment explains the next instruction.
console.log("Comments are not output.");Comments are not output.
The comment is skipped; the correctly spelled log method displays the string.
// This comment explains the next instruction.A comment explains intent to a reader and does not execute.
console.log("Comments are not output.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
// This comment explains the next instruction.
console.log("Syntax has a purpose.");Syntax has a purpose.
The comment is skipped; the correctly spelled log method displays the string.
// This comment explains the next instruction.A comment explains intent to a reader and does not execute.
console.log("Syntax has a purpose.");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
// This comment explains the next instruction.
console.log("Spaces inside strings count.");Spaces inside strings count.
The comment is skipped; the correctly spelled log method displays the string.
// This comment explains the next instruction.A comment explains intent to a reader and does not execute.
console.log("Spaces inside strings count.");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.
// This comment explains the next instruction.
console.lgo("Comments are not output.");// This comment explains the next instruction.
console.log("Comments are not output.");JavaScript names are case-sensitive and spelling-sensitive. Read an error’s line before changing unrelated code.
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.