Pass i variable to IIFE

The document states 'This will work as we expect it to, with each element getting the correct value of i...' which is not true, since, inside the IIFE, i is undefined