Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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