I don't understand why we exported only the get function
Hello, as I was watching this video the teacher made a module with most of the code inside it. I don't understand why we exported only on part of the module. Why? the code needs the whole module to work.. Somewhere I am confused. It would be great if someone could explain it to me.
Evan Demaris64,248 Points
get is the only function exported because it's the only function you'd actually call in the main app. Meaning, all other functions in profile.js are used by the
get function so they aren't called by the main app directly. When
get is called, it has access to the other functions in profile.js so it works correctly.
Hope that helps!