---
title: "Discussion on \"JavaScript Using generator function\" | Hashnode"
description: "Discussion on \"JavaScript Using generator function\". Consider the following custom Iterator.\nfunction makeRangeIterator(start = 0, end = Infinity, step = 1) {\n  let nextIndex = start;\n  let iterationCount = 0;\n\n  const rangeIterator = {\n    next() {\n      let result;\n      if (nextIndex < end) {\n      ..."
url: "https://hashnode.com/posts/javascript-using-generator-function/634e4190c1810b9f1ee2e7dd"
---

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

Discussion

# [JavaScript Using generator function](https://loganlee.hashnode.dev/javascript-using-generator-function?utm_source=hashnode&utm_medium=feed)

Consider the following custom Iterator. function makeRangeIterator(start = 0, end = Infinity, step = 1) { let nextIndex = start; let iterationCount = 0; const rangeIterator = { next() { let result; if (nextIndex < end) { ...

Oct 18, 2022 · 2 min read · loganlee.hashnode.dev  
Read the article

-   [#generator](https://hashnode.com/tag/generator)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#iterator](https://hashnode.com/tag/iterator)

## Written by

[Logan Won-Ki Lee](https://hashnode.com/@loganlee)

@loganlee

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

Linux programmer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
