Why would anyone need JavaScript generator functions?
08-Nov-2024 82
Generators are an odd part of the JavaScript language. And some people find them a bit of a puzzle. You might be a successful developer for decades and never feel the need to reach for them. Which raises the question, if you can go so long without ever needing them, what are they good for?
Generators have a funny syntax, too. They have these strange starred function definitions; you can’t define them with arrow functions; they add this mysterious yield keyword. If you’re not familiar with what they’re doing, they can make code impossible to read.
Why would anyone need JavaScript generator functions? #js #javascript #would #anyone #JavaScript #generator #functions? #javascript https://www.javascript.ba/link/why-would-anyone-need-javascript-generator-functions