It was unclear (magical even) where the index value "i" was initialized and maintained in the second version of the code. It continues to be delivered to the subscribers but makes no appearance in the code.
You say @ 1:30 or so that the new Observable has internal to it the machinery of remembering the increment, but how did it get there? It looks in the code as if you reasssigned foo, with no mention of those internals and yet it was transferred.
Can you explain what I'm missing here? Ta.
i is a function-scoped variable that the inner function has access to through its variable scope chain (think closures). Variables defined by