Quiz

  1. Can you explain number 4?

    Sure. Here is it:

    Our LocalStore class for CoffeeRun differs from the DataStore class by (check all that apply)
        A.      arguments to the constructor
        B.      implementation for the constructor
        C.      arguments and return values for methods
        D.      implementation for the methods        
    

    All but C change. The best way to see that is to do a side-by-side-comparison:

    DataStore and LocalStore.

  2. Can we go over JSON.parse() and JSON.stringify()? I don't feel like I fully understand their uses.

    Sure. Let's go back to the JSON part of the reading.

  3. can you elaborate on the impact between servers? Like how and why we might interfere with the variables of another website?

    Suppose I have high scores on one page

    https://cs.wellesley.edu/~anderson/myscores.html
    and coffee orders on another page
    https://cs.wellesley.edu/~cs204/coffeerun/basic-ls/
    , but those pages have the same origin, clearing the localstorage for that origin affects both.

    Better to just remove the key/value pairs used in that app.

  4. How are LocalStorage and a browser's cache different? They seem to be very similar concepts.

    Interesting question! Yes, they are similar, in that they can persist across browser sessions and are saved to the local filesystem.

    However, we have little control over the cache from JavaScript. We can't take anything out, or look anything up. So, in terms of the functionality for our web apps, they are very different.

  5. Nominations: DataStore; DataLocalStore

    Good ones! On Thursday, we'll be looking at RemoteDataStore, so maybe LocalDataStore?