generator closure

Run Settings
LanguageJavaScript
Language Version
Run Command
const generator = () => { let i = 0 return () => i++ } const generatorInstance = generator() console.log(generatorInstance()) console.log(generatorInstance()) console.log(generatorInstance()) console.log(generatorInstance()) const secondGeneratorInstance = generator() console.log(secondGeneratorInstance()) console.log(secondGeneratorInstance())
Editor Settings
Theme
Key bindings
Full width
Lines