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:

Buck
11 hours ago
I'm going with option B. The `url` variable is global, so `console.log('The current URL is: ' + url)` should work just fine.
upvoted 0 times
...
Thomasena
13 days ago
But doesn't the function setCurrentUrl() define the url variable locally?
upvoted 0 times
...
Catina
15 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
16 days ago
I believe it's C.
upvoted 0 times
...
Thomasena
25 days ago
I think the answer is B.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77