I have a TypeScript class List which is imported. (It acts like a Singly Linked List). I am trying to implement an iterator for the class.
List.prototype[Symbol.iterator] = function* gen() {
...
};
However, TypeScript server says "Element implicitly has an 'any' type because expression of type 'symbol' can't be used to index type 'List'".
What is the proper way of implementing and using an iterator for a TypeScript class?