Skip to content

Instantly share code, notes, and snippets.

@nikhilmufc7
Created December 17, 2016 15:09
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 nikhilmufc7/206a11f1813cb9de0e1d1014779ba853 to your computer and use it in GitHub Desktop.
Save nikhilmufc7/206a11f1813cb9de0e1d1014779ba853 to your computer and use it in GitHub Desktop.
What is scope? Your explanation should include the idea of global vs. local scope.
A. Scope is the declaration and accesibility that is possible in javascript, i.e the local and global scope wherin the variables
get stored in a global way, that can accessed anywhere in the program or
a Local variables have ,They can only be accessed within the function.
Why are global variables avoided?
Global variables are avoided because it creates a fuss if we programming 1000s of lines of codes.
Explain JavaScript's strict mode?
Strick mode is a way of writing secure javascript. It helps us in avoiding globad variables. It will throw an error if the
variable used is not declared.
Explain variable hoisting in JavaScript.
Hositing in javascript is that a variable can be declared after it has been used or before it has been used. Javascript engine
is well versed in evaluating it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment