Question 19
Back to Exercise
What does the following JavaScript code print (console output, as in Node.js)?
let rate = 5;
const interest = (p) => (p * rate) / 100;
rate = 8;
console.log(interest(1000));
- A 80 Correct
- B 50
- C 130
- D NaN
Correct Answer: Option A
A closure keeps a live link to the variable, not a copy of its value. When interest runs, rate is already 8.
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!