Given the code below:
Setcurrent URL ();
console.log(‘The current URL is: ‘ +url );
functionsetCurrentUrl() {
Url = window.location.href:
What happens when the code executes?
The url variable has local scope and line 02 throws an error.
The url variable has global scope and line 02 executes correctly.
The url variable has global scope and line 02 throws an error.
The url variable has local scope and line 02 executes correctly.
Submit