News for hackers. Stuff that matters.
Re:I'm Switching to Python and Actually Liking It by c6401 on Tuesday July 22, 2025 @11:20PM (#44655435)
JS used to have those, now they are deprecated though:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

so it settled on having this syntax for similar cases using "Symbol":

class Foo { *[Symbol.iterator]() { yield 1; yield 2; yield 3; } }

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

There are no comments on this comment yet.