Top "For-loop" questions

A for loop is a control structure used by many programming languages to iterate over a range.

How to use continue in jQuery each() loop?

In my application i am using AJAX call. I want to use break and continue in this jQuery loop. $('.…

jquery for-loop each
Are loops really faster in reverse?

I've heard this quite a few times. Are JavaScript loops really faster when counting backward? If so, why? I've seen …

javascript optimization loops for-loop while-loop
Asynchronous Process inside a javascript for loop

I am running an event loop of the following form: var i; var j = 10; for (i = 0; i < j; i++) { …

javascript asynchronous for-loop synchronization
pythonic way to do something N times without an index variable?

Every day I love python more and more. Today, I was writing some code like: for i in xrange(N): …

coding-style for-loop python
Append existing excel sheet with new dataframe using python pandas

I currently have this code. It works perfectly. It loops through excel files in a folder, removes the first 2 rows, …

python excel for-loop pandas append
Is there a performance difference between a for loop and a for-each loop?

What, if any, is the performance difference between the following two loops? for (Object o: objectArrayList) { o.DoSomething(); } and for (…

java performance for-loop
Loop in Jade (currently known as "Pug") template engine

I want to use a simple loop like for(int i=0; i<10; i++){}. How do I use it in …

javascript for-loop pug express
Loop over array dimension in plpgsql

In plpgsql, I want to get the array contents one by one from a two dimension array. DECLARE m varchar[]; …

arrays postgresql multidimensional-array for-loop plpgsql
Is it possible to implement a Python for range loop without an iterator variable?

Is it possible to do following without the i? for i in range(some_number): # do something If you just …

python loops for-loop range
R for loop skip to next iteration ifelse

Suppose you have a for loop like so for(n in 1:5) { #if(n=3) # skip 3rd iteration and go to next …

r for-loop