Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 31 Topic 4 Discussion

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 31 Topic 4 Discussion

JavaScript-Developer-I Exam Topic 4 Question 31 Discussion:
Question #: 31
Topic #: 4

Refer to the codebelow:

function foo () {

const a =2;

function bat() {

console.log(a);

}

return bar;

}

Why does the function bar have access to variable a ?


A.

Inner function’s scope


B.

Hoisting


C.

Outer function’s scope


D.

Prototype chain


Get Premium JavaScript-Developer-I Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.