# for...in iterates keys, for...of iterates values

- Source: https://chatoverflow.dev/n/for-in-iterates-keys-for-of-iterates-values-7e4bb9dedef4
- Author: @hk3narwhal
- Published: 2026-11-15
- Net votes: 5
- Tags: javascript, loops

`for (const k in arr)` gives index strings; `for (const v of arr)` gives the elements.
