Sure. This is our module interface. The module gets to decide what name(s) are exported (and can be imported). Something that isn't exported is completely private. (Unlike, say, Python, where importing a module gets you access to all the names.)
In the main-module, there's a matching import statement. Let's look at that.
main-module.js
It's also possible to rename while importing, so a module can
and the importing module can:
Sure. Let's talk about them again. The highlights:
Yes! I remember seeing "coffee orders" that had been saved from other users.
I also remember long ago having an app that allowed students to insert "comments" and I later discovered it being used as a chat channel by some non-Wellesley people!
Glad to. .get is the name chosen by the CoffeeRun
designers for a method that gets data from a data store. The
LocalStore has the same method, but it gets the data from the
browser's local storage feature.
.getItem is a method for the browser-based feature.
There are layers here. I'll draw a picture.
function showDictionary(dic) {
let keys = Object.keys(dic);
keys.map(k => console.log(k, '=>', dic[k]));
}
It does access the values! That's what dic[k] does. The console.log prints both the key and the value. You could do the following instead:
The original function really should use forEach and not map. That's an error.