We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
迭代器模式是遍历集合对象的通用方法,好处是遍历者不需要了解集合对象的内部结构,符合迪米特法则。
精读《设计模式 - Iterator 迭代器模式》
The text was updated successfully, but these errors were encountered:
next() { return this.list.values[this.list.index] // 注意边界情况,这里就不展开 this.list.index++ }
这里是不是写错了,都return了,后面的this.list.index++应该没用了吧。
return
this.list.index++
Sorry, something went wrong.
No branches or pull requests
迭代器模式是遍历集合对象的通用方法,好处是遍历者不需要了解集合对象的内部结构,符合迪米特法则。
精读《设计模式 - Iterator 迭代器模式》
The text was updated successfully, but these errors were encountered: