Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 18 Topic 2 Discussion

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 18 Topic 2 Discussion

JavaScript-Developer-I Exam Topic 2 Question 18 Discussion:
Question #: 18
Topic #: 2

Given the code below:

Setcurrent URL ();

console.log(‘The current URL is: ‘ +url );

functionsetCurrentUrl() {

Url = window.location.href:

What happens when the code executes?


A.

The url variable has local scope and line 02 throws an error.


B.

The url variable has global scope and line 02 executes correctly.


C.

The url variable has global scope and line 02 throws an error.


D.

The url variable has local scope and line 02 executes correctly.


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.