---
title: "Comment by Júlio César Ködel on \"I can't write a JavaScript for loop, and it does not matter\" | Hashnode"
description: "This is one of the most stupid article I began to read (could not read until the end, too painfull). There is a lot of uses for indexed array access (including,"
url: "https://hashnode.com/posts/i-cant-write-a-javascript-for-loop-and-it-does-not-matter/5f76e5b37d160d41227d65cb/comment/5f7f4166b8638504a7c11eda"
---

[Discussion](https://hashnode.com/posts/i-cant-write-a-javascript-for-loop-and-it-does-not-matter/5f76e5b37d160d41227d65cb)

Comment [I can't write a JavaScript for loop, and it does not matter](https://hashnode.com/posts/i-cant-write-a-javascript-for-loop-and-it-does-not-matter/5f76e5b37d160d41227d65cb)

[Júlio César Ködel](https://hashnode.com/@jck)

[Oct 8, 2020](https://hashnode.com/posts/i-cant-write-a-javascript-for-loop-and-it-does-not-matter/5f76e5b37d160d41227d65cb/comment/5f7f4166b8638504a7c11eda)

This is one of the most stupid article I began to read (could not read until the end, too painfull).

There is a lot of uses for indexed array access (including, for instance, comparing or using two correlated arrays with only one loop, instead of a nested loop).

Using a function call requires stack manipulation, context switching, etc. Is slow as hell. Thousands of times slow (but don't trust me, do a test, as any scientific method requires).

You are just a bad programmer and hashnode just became a Medium competitor (in article quality).

[Sébastien Lorber](https://hashnode.com/@sebastienlorber)

[Oct 8, 2020](https://hashnode.com/posts/i-cant-write-a-javascript-for-loop-and-it-does-not-matter/5f76e5b37d160d41227d65cb/comment/5f7f4166b8638504a7c11eda#reply-5f7f6f35addab004867df756)

I can indeed write for loops with indices if perf matters, but in most cases it's premature optimisation.

Do you always prematurely optimize? Do you feel a for loop is always the best solution for lists of size 10?
