in JavaScript by

What output will be returned by the function in the following code?

var scope ="global scope";  



var scope ="local scope";  



return scope;  


return f;  


a) It will returns the value in scope

b) It will returns value null

c) It will returns an exception

d) It will show an error message

1 Answer

0 votes

Answer: A

Reason: Each block of code, function, or script as a whole always has an object, associated with them, called a Lexical environment. Therefore, the JavaScript code given in the above question will return the value in scope.

Related questions

+1 vote
asked Mar 22 in JavaScript by Robindeniel
0 votes
asked Mar 22 in JavaScript by Robindeniel