298028 (3) [Avatar] Offline
in the v8 pdf

p 72 - let todoIndex = 0
p 74 - const todoIndex = 0

1) Is there a reason this isn't part of the component state?

2) I'm surprised that marking todoIndex as 'const' you are able to update the number in submitTodo()
287516 (45) [Avatar] Offline
Hello, and thanks for pointing this out!

`todoIndex` should indeed be let not const consistently, we will update this in the next release.

As far as todoIndex being stored in the state, it may make more sense to do so, but it is also worth noting this pattern as it is sometimes used in Redux which we will be covering at a later time, though I think in this case storing it in the state would be less confusing and I may refactor to do so in a future release.

Thanks for the feedback, much appreciated!