Top "Iteration" questions

Iterations are the successive repetitions in loops such as for, foreach or while.

Iterating through a range of dates in Python

I have the following code to do this, but how can I do it better? Right now I think it's …

python date datetime iteration
What exactly are iterator, iterable, and iteration?

What is the most basic definition of "iterable", "iterator" and "iteration" in Python? I have read multiple definitions but I …

python iterator iteration terminology iterable
How to loop through key/value object in Javascript?

var user = {}; now I want to create a setUsers() method that takes a key/value pair object and initializes the …

javascript loops for-loop iteration key-value
What is the perfect counterpart in Python for "while not EOF"

To read some text file, in C or Pascal, I always use the following snippets to read the data until …

python file iteration eof
Remove elements from collection while iterating

AFAIK, there are two approaches: Iterate over a copy of the collection Use the iterator of the actual collection For …

java collections iteration
How to skip to next iteration in jQuery.each() util?

I'm trying to iterate through an array of elements. jQuery's documentation says: jquery.Each() documentation Returning non-false is the same …

javascript jquery iteration
Fastest way to iterate over all the chars in a String

In Java, what would the fastest way to iterate over all the chars in a String, this: String str = "a …

java string performance char iteration
Python using enumerate inside list comprehension

Lets suppose I have a list like this: mylist = ["a","b","c","d"] To get the values printed along with …

python list iteration list-comprehension
"for" vs "each" in Ruby

I just had a quick question regarding loops in Ruby. Is there a difference between these two ways of iterating …

ruby loops foreach iteration each
Best way to iterate through a Perl array

Which is the best implementation(in terms of speed and memory usage) for iterating through a Perl array? Is there …

arrays perl iteration