Topics Covered
The big ideas from this semester, through basic databases. Each area links to one or two class examples
that show it well. Open them, read the code, and make sure you could explain what each part does.
HTML and CSS
- Structure of a page:
head, body, common elements, empty containers for JavaScript to fill
- Forms and inputs: text inputs, buttons, dropdowns, submit
- CSS basics: selecting elements by tag, id, and class; margin and padding; basic flexbox
- Loading JavaScript into a page (inline, external with
defer, libraries from a CDN)
Examples: CSS basics (9/11), Pokémon cards (9/22)
JavaScript Fundamentals
- Variables, strings, numbers, comparisons,
if / else
- Loops:
for, for...of, while, forEach
- Random numbers
Example: Loops, sorting, and function syntax (10/2)
Arrays and Objects
- An array of objects as the data behind an app
- An object as a lookup table (
rooms["entry"])
- Objects are references: changing one changes it everywhere
- Array methods:
map, sort, forEach, filter
Examples: Adventure game (9/25), Classes and map (10/20)
Functions
- Functions as values: storing them in variables, passing them to other functions (callbacks)
- The different ways to write a function, including arrow functions
- Closures: a function remembering the variables around it
Examples: Callbacks (9/29), Closures (10/6)
Classes
class, constructor, this, methods, new
- An array of objects made from a class, each updating itself
Examples: MyArray class (10/20), p5 creatures (10/30)
The DOM and Events
- Finding elements, creating new ones, and adding them to the page
- Building the page from data, and clearing and redrawing it when the data changes
- Responding to the user: click, change, and submit events; the event object;
preventDefault
Examples: Buttons and adventure game (9/25), Forms (10/9)
Saving Data in the Browser
localStorage
- JSON: turning data into a string and back (
JSON.stringify, JSON.parse)
Example: Forms and localStorage (10/9)
Asynchronous JavaScript and APIs
- Code that finishes later:
setTimeout, promises
fetch to get data from a public API
async / await
- Reading nested data that comes back from an API
Examples: Promises and fetch (10/23), p5 and PokeAPI (10/27)
Node and Servers
- Running JavaScript outside the browser; reading and writing files
- What a server is: requests and responses, URLs, ports
- Express: routes, serving a folder of files, sending JSON
- Sending data to a server: query parameters, POST with a JSON body
- A front end that talks to its own server with
fetch
Examples: Basic Node server (11/6), Express with GET and POST (11/13)
Calling APIs from the Server, Secrets, and Hosting
- The server calls an outside API and passes the result to the page
- Keeping keys and passwords secret in
.env
- Static hosting (GitHub Pages) vs. running a server (Render)
Examples: Gemini from our server (11/17), Hosting a server on Render
Basic Databases
- Why a database instead of a file
- Connecting from the server; databases, collections, and documents
- Adding data from a form: browser, then our server, then the database
Examples: Saving to-dos (11/20), Setting up a database