When someone tells you that something is or is not part of a project, what does it mean?
As you can see, when "console.log ()" the result of the invoked greeting function, we are able to access to the WebsiteName after the function was played. This gives us the "Hello Karma Career‚" channel that we were looking for. As already mentioned the console.log ()
of the variable that was declared in the function generates an error because it cannot be defined.
, the reason WebsiteName is undefined is because variables are created inside functions when called, and then destroyed when the terminal instruction is executed. Anything outside the function does not have access to things inside the function, unless it has a particular configuration.
This next field is pretty much a literal translation of the phrase. A global scope takes elements declared outside of a function and reserves them in a space where all scripts, methods, and functions can access and use them for their own logic.
What does the above code do if
console.log () counts at the end of the code ? What do you hope will happen?