Thanks for the input — I thought that even if the constant doesn’t matter, O(xn) == O(n) in a theory level, the 2n still makes sense in most people’s heads, even if we shouldn’t optimize for it.

What I’m saying is that even if optimizing for constant time multiplier is not really a thing, it still can be used as a teaching point — this article, as I intended it, isn’t “Rust > JS” it’s “Learn Rust iterator through scope of JS”.

When I get to my computer, I’ll make sure to emphasize that in the article :) thanks for the help and thanks for reading!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store