---
title: "Comment by Dinys Monvoisin on \"JS for..of and for..in\" | Hashnode"
description: "Would not it better off saying that for...of is used with array type values only rather than saying it generates an error message?"
url: "https://hashnode.com/posts/js-for-of-vs-for-in/5f6391b8db767922c472e27a/comment/5f645e3ca2a2fb2455127984"
---

[Discussion](https://hashnode.com/posts/js-for-of-vs-for-in/5f6391b8db767922c472e27a)

Comment [JS for..of and for..in](https://hashnode.com/posts/js-for-of-vs-for-in/5f6391b8db767922c472e27a)

[Dinys Monvoisin](https://hashnode.com/@dinmon)

[Sep 18, 2020](https://hashnode.com/posts/js-for-of-vs-for-in/5f6391b8db767922c472e27a/comment/5f645e3ca2a2fb2455127984)

Would not it better off saying that `for...of` is used with array type values only rather than saying it generates an error message?

[drxlopez](https://hashnode.com/@gabslach)

[Sep 18, 2020](https://hashnode.com/posts/js-for-of-vs-for-in/5f6391b8db767922c472e27a/comment/5f645e3ca2a2fb2455127984#reply-5f648dfe96b4a436fe135e9c)

Good point, I only chose to describe it that way to emphasize it haha.

[Dinys Monvoisin](https://hashnode.com/@dinmon)

[Sep 18, 2020](https://hashnode.com/posts/js-for-of-vs-for-in/5f6391b8db767922c472e27a/comment/5f645e3ca2a2fb2455127984#reply-5f64981996b4a436fe135f0b)

It make it confusing and imagine someone who is starting.
