---
title: "Discussion on \"What are JS Generators?\" | Hashnode"
description: "Discussion on \"What are JS Generators?\". What are JS Generators?\nGenerators are a feature in Javascript which are basically functions that are kind of like iterators.\nCreating\nYou can create generators like this:\nfunction* myGenerator() {}\n\nThe * after function is required.\nYielding\nThe cor..."
url: "https://hashnode.com/posts/what-are-js-generators/5fc7d5296819c54efdf2e68e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What are JS Generators?](https://h.shadowtime2000.com/what-are-js-generators?utm_source=hashnode&utm_medium=feed)

What are JS Generators? Generators are a feature in Javascript which are basically functions that are kind of like iterators. Creating You can create generators like this: function\* myGenerator() {} The \* after function is required. Yielding The cor...

Dec 2, 2020 · 2 min read · h.shadowtime2000.com  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#node](https://hashnode.com/tag/node)

## Written by

[shadowtime2000](https://hashnode.com/@shadowtime2000)

@shadowtime2000

  
[View profile](https://hashnode.com/@shadowtime2000)

I program

If you are looking at this you are probably wondering who I am.

## Responses 1

Markdown supported · ⌘↵ to post

[Todd](https://hashnode.com/@toddpress)

[Dec 3, 2020](https://hashnode.com/posts/what-are-js-generators/5fc7d5296819c54efdf2e68e/comment/5fc941f005b16664beec480e)

I've been curious for some time now about generators. They seem incredibly powerful; yet I've never used them IRL. What are some real-world use cases for generators?

[shadowtime2000](https://hashnode.com/@shadowtime2000)

[Dec 3, 2020](https://hashnode.com/posts/what-are-js-generators/5fc7d5296819c54efdf2e68e/comment/5fc941f005b16664beec480e#reply-5fc94221df0f3764e3defb78)

I believe they are mainly for readable iterators.
