ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 55 - Certified JavaScript Developer I discussion

Report
Export

Given the code below:

Function myFunction(){

A =5;

Var b =1;

} myFunction();

console.log(a);

console.log(b);

What is the expected output?

A.
Both lines 08 and 09 are executed, and the variables are outputted.
Answers
A.
Both lines 08 and 09 are executed, and the variables are outputted.
B.
Line 08 outputs the variable, but line 09 throws an error.
Answers
B.
Line 08 outputs the variable, but line 09 throws an error.
C.
Line 08 thrones an error, therefore line 09 is never executed.
Answers
C.
Line 08 thrones an error, therefore line 09 is never executed.
D.
Both lines 08 and 09 are executed, but values outputted are undefined.
Answers
D.
Both lines 08 and 09 are executed, but values outputted are undefined.
Suggested answer: B
asked 23/09/2024
john rosselot
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first