Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Javascript Developer I Topic 3 Question 89 Discussion

Actual exam question for Salesforce's Javascript Developer I exam
Question #: 89
Topic #: 3
[All Javascript Developer I Questions]

Given the code below:

Setcurrent URL ();

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

functionsetCurrentUrl() {

Url = window.location.href:

What happens when the code executes?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Thomasena
4 days ago
But doesn't the function setCurrentUrl() define the url variable locally?
upvoted 0 times
...
Catina
7 days ago
Hmm, this looks like a classic scope issue. I'm guessing the variable `url` is declared outside the `setCurrentUrl()` function, so it should have global scope. Let's see what the rest of the candidates think.
upvoted 0 times
...
Lauran
7 days ago
I believe it's C.
upvoted 0 times
...
Thomasena
17 days ago
I think the answer is B.
upvoted 0 times
...

Save Cancel