oreillymedia / data_structures_and_algorithms_using_javascript

768 stars 407 forks source link

an endless loop in chapter 3 #9

Closed sweet-zone closed 9 years ago

sweet-zone commented 9 years ago

we use these code to traverse the names List in chapter, but, the property 'pos' will alaways less than 'listSize', so there will be a endless loop..

for(names.front(); names.currPos() < names.length(); names.next()) {
print(names. getElement());
}
karent commented 9 years ago

I've reported this on the title's errata page. You can check it out here: http://www.oreilly.com/catalog/errataunconfirmed.csp?isbn=0636920029557. This should be corrected in the next reprint.