Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What is scope? I like to think of scope as if it were a russian stacking doll. There is the outer-most layer, that can contain rules that
- /could/ interact with it's inner layers, if the inner layers do not write their own code. Another way to describe it, might be National laws,
- State Laws, and County laws.
- Why are global variables avoided? Global variables are to be avoided because it can cause pure code to become indefinitive, and could break,
- change, or just be a bit unreliable. Basically, it's always better to work within your scope, rather than relying on global variables.
- --I think it's just best practice, and a way to be thorough and safe in making sure your code is solid.
- Explain JavaScript's strict mode. Strict mode helps identify problems with poor naming methods quickly. As far as my experience with it, it
- helps aid in using 'let' rather than directly or "sloppily" naming a variable.
- What are side effects, and what is a pure function?
- Side effects might be variables overriding one another, causing code to break or have bugs. A pure function, is one that's code is always
- the same return every time, another word I might use, would be reliable functions. You can always count on them to be functioning as intended.
Add Comment
Please, Sign In to add comment