Traversing items of custom data structures, like trees or linked lists, require knowledge of how that data structure is built. That can lead to problems, as faulty iteration strategies might not visit all the items, or they might not know when they've finished visiting all of them. In this lesson, we're going to look at how TypeScript supports us in building custom ES6 iterators that can be then used by a simple "for..of" loop to ensure we provide an easy to use and reliable API for other developers to traverse our data structures.
Interesting lesson!
This is such a solid course, thank you Rares.
So very well explained. Many thanks.
I got this error Type 'null' is not assignable to type 'ListNode<Action>', but it worked for you, why?
"I got this error Type 'null' is not assignable to type 'ListNode<Action>', but it worked for you, why?"
You have to turn off strictNullChecks in your tsconfig.