MODULO Full Stack Web Development: The Ultimate Master SagaTHEORY
Follow a variable through a block
Set let seats = 2. Inside an if block declare a new let seats = 1 and log it. Log seats again outside. Predict both outputs, then remove the inner let and rerun.
Check your work
With the inner declaration the outputs are 1 and 2. Without it the assignment updates the outer binding, producing 1 and 1. Keeping the same variable name can hide which state your code changes.
