← All tasks
🔍
Programming Intermediate

Fix a Closure That Doesn't Capture an Outer Variable

⏱ 5 min ⭐ 120 XP 🔁 3 attempts allowed

What you'll do

Find the line where a closure fails to reference an outer-scope variable because 'use' was omitted.

Scenario

A closure meant to add a fixed $tax rate to each price throws an undefined variable warning for $tax.

Ready to try it?

Create a free account and try "Fix a Closure That Doesn't Capture an Outer Variable" free for 7 days, no card required. Earn 120 XP and track your internship progress.

Already have an account? Sign in