Skip to content

Instantly share code, notes, and snippets.

@Osman8a
Created December 18, 2018 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Osman8a/01996e2463a81ee99efdebf253dfc174 to your computer and use it in GitHub Desktop.
Save Osman8a/01996e2463a81ee99efdebf253dfc174 to your computer and use it in GitHub Desktop.
Challenge: In your own words
A) What is scope? Your explanation should include the idea of global vs. local scope.
R= the scope defines how you can or can not access the variables that you declare in different points of your code.
When you declare a variable in the global scope, it is available throughout the code.
When you declare a variable in the local scope, it will be available only within the function
B) Why are global variables avoided?
R= the use of global variables can generate unintentional errors in my code when I have local variables called in the same way
C) Explain JavaScript's strict mode
R= imposes the strict use of Javascript in my code
D)What are side effects, and what is a pure function?
R= a function is pure when it is determined and has no side effects
E) Explain variable hoisting in JavaScript.
R = Elevation refers to the way in which the JS interpreter finds each variable declaration within a certain scope,
and moves it to the beginning of that scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment