Foundations

Fix the Counter

Fix the Counter

This retry counter is supposed to increase twice and log 2, but the current declaration prevents reassignment.

Your task: Fix the declaration so the counter can change. Keep the two updates and the log.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Fix the Counter

This retry counter is supposed to increase twice and log 2, but the current declaration prevents reassignment.

Your task: Fix the declaration so the counter can change. Keep the two updates and the log.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Console

Run code to see output.