addyosmani / essential-js-design-patterns

Repo for my 'Learning JavaScript Design Patterns' book
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
4.83k stars 792 forks source link

missing operator in ObserverList indexOf-function #45

Closed FrankBerlin closed 11 years ago

FrankBerlin commented 12 years ago

in the indexOf function of ObserverList in the Observer Pattern chapter the value of i does not get changed inside the while loop. my guess is that at some point it should make an i++, or we create an infinite loop.

BR Frank

addyosmani commented 12 years ago

Adding your comment from the blog so they can both be addressed:

Also the function removeAt() from the ObserverList prototype is later (in the Subject code) called removeIndexAt().

Thanks for posting the issue!