Question 7
Back to Exercise
What does the following JavaScript code print (console output, as in Node.js)?
function outer() {
const inner = () => arguments[0];
return inner("ignored");
}
console.log(outer("outer-arg"));
- A outer-arg Correct
- B ignored
- C undefined
- D ReferenceError
Correct Answer: Option A
The arrow has no arguments object of its own, so the name resolves to outer's arguments.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!