ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 135 - Certified JavaScript Developer I discussion

Report
Export

Given the code below:

Setcurrent URL ();

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

function setCurrentUrl() {

Url = window.location.href:

What happens when the code executes?

What happens when the code executes?

A.
The url variable has local scope and line 02 throws an error.
Answers
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.
Answers
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.
Answers
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.
Answers
D.
The url variable has local scope and line 02 executes correctly.
Suggested answer: B
asked 23/09/2024
long tran
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first