QUICK LOOKUP
Quick Reference
Find a concept, then return to its full lesson.
| Topic | Use it to |
|---|---|
| Getting Started | Make your first program and connect JavaScript to HTML. |
| Variables and Data Types | Name values and distinguish text, numbers, and booleans. |
| Operators and Strings | Calculate results, compare values, and build messages. |
| Conditions and Decisions | Choose a path with if, else, and comparisons. |
| Functions and Scope | Package steps, accept inputs, and return a result. |
| Arrays and Loops | Store a list and repeat work for each item. |
| Objects and Array Methods | Describe related data and transform collections. |
| Changing the Page | Select HTML elements and change their content. |
| Events and User Input | Respond to clicks and read a visitor’s input. |
| Debugging and a Mini Project | Read errors and combine variables, functions, and events. |
Common patterns
const name = "Nicole";
let count = 0;
if (count === 0) { console.log("Begin"); }
function double(value) { return value * 2; }
for (const item of [1, 2, 3]) { console.log(item); }
const title = document.querySelector("h1");
if (title) { title.textContent = "Hello"; }Vocabulary
Expression: code that produces a value. Statement: an instruction. Callback: a function passed to other code to be called. Scope: where a name is available. DOM: the browser’s object representation of HTML. Event: a notification of an occurrence, such as a click.
When something breaks
- Read the first relevant console error and its line number.
- Check spelling and capitalization.
- Log the input values and their types.
- Check whether a DOM selection returned null.
- Make one small change and run again.