If statement

Dog pack

The story so far

Persisting record sets

There's a problem with the course data app in the previous lesson. It doesn't remember anything. We created a record set when the page loads:

(function($) {
    //Initialize course catalog.
    var catalog = [
        {
            id: 42,
            title: "Web apps for happy dogs",
            maxEnrollment: 40,
            location: "Monty Hall 301"
        },
        ...
    ];

It was lost when the page ended.

We want something like this:

bc.

Coffee and chocolate (validation, localStorage)

The story so far

The piggy bank app persisted data to localStorage. localStorage stores string data, with string keys.

Let's make something like the piggy bank app, but a bit more complex

Requirements

Goals

Make an app that tracks your coffee and chocolate expenses. When you buy some coffee, you enter the amount you spend, and it gets added to a coffee total. Same for chocolate.

The totals are persistent.

You can try a partial version of it.