Welcome to Data Drives the Page. Priya hosts a board game night. Her page keeps its guest list in an array, but who’s arrived lives on the page, and the arrival count drifts. This course makes the data the one truth.
You’ll build Priya a scorekeeper for her game. Wei scores in round 1 and takes the lead. In round 2, Amara scores twice and goes ahead. Undo last round takes round 2 back, so Wei leads again. Remove Wei, and with the other three tied at 0, nobody leads.
Each click changes only the data. Your code then draws the page again from it, so the totals always match the scores.
What You’ll Learn
Here’s what each part of the course has you do:
- Keeping Lists in Arrays: You line up tonight’s games in arrays.
- Handling a Whole List: You cover a whole list with one listener, even rows added later.
- Drawing the Page From Data: You make the guest records the one truth that the page is drawn from.
- Splitting the App Into Modules: You split the code into modules.
- Project: Priya’s Score Keeper: You build the scorekeeper.
By the end of this course, you’ll be able to keep an app’s data in one place and redraw the page from it, with one listener handling a whole list, and split the app into modules.
Before You Start
You should know JavaScript basics, such as arrays, objects, and functions. You should also know how to find and create elements, listen for clicks, and change classes and data attributes.
You’ll use a current version of Chrome or Edge, and a local server, such as VS Code’s Live Preview, to serve the page.
If you’ve already built Priya’s page, keep your files and carry on in them. If you’re starting here, the first lesson sets you up.
How the Course Works
In text lessons, you type along and check what the Console shows. The first four sections each end with an exercise, and automated tests check your code.
The project comes in three graded steps, and then you explain your scorekeeper to the mentor, RealJS’s AI tutor. A quiz and a summary close the course.
The next lesson is Add and Remove at the Ends.