如何使Typescript对象可迭代?在Python 3中,我可以做到
class EndlessCounter:
def __init__(self):
self.count = 0
def __iter__(self):
return self
def __next__(self):
self.count += 1
return self.count
Run Code Online (Sandbox Code Playgroud)
但是这段代码的Typescript等价物是什么?
谢谢!
typescript ×1