Top "Loops" questions

Loops are a type of control flow structure in programming in which a series of statements may be executed repeatedly until some condition is met.

How do I iterate over a JSON structure?

I have the following JSON structure: [{ "id":"10", "class": "child-of-9" }, { "id": "11", "classd": "child-of-10" }] How do I iterate over it using JavaScript?

javascript json loops
Batch script loop

I need to execute a command 100-200 times, and so far my research indicates that I would either have to …

windows loops batch-file
Why is using "for...in" for array iteration a bad idea?

I've been told not to use for...in with arrays in JavaScript. Why not?

javascript arrays loops for-loop iteration
How to enumerate an enum

How can you enumerate an enum in C#? E.g. the following code does not compile: public enum Suit { Spades, …

c# .net loops enums enumeration
Traverse a list in reverse order in Python

So I can start from len(collection) and end in collection[0]. I also want to be able to access the …

python loops reverse
Python - TypeError: 'int' object is not iterable

Here's my code: import math print "Hey, lets solve Task 4 :)" number1 = input ("How many digits do you want to look …

python list loops iterable
C# loop - break vs. continue

In a C# (feel free to answer for other languages) loop, what's the difference between break and continue as a …

c# loops enumeration
How to Iterate over a Set/HashSet without an Iterator?

How can I iterate over a Set/HashSet without the following? Iterator iter = set.iterator(); while (iter.hasNext()) { System.out.…

java loops set hashset
How to loop through array in jQuery?

I am trying to loop through an array. I have the following code: var currnt_image_list= '21,32,234,223'; var …

javascript jquery arrays loops iteration
How to find the foreach index?

Is it possible to find the foreach index? in a for loop as follows: for ($i = 0; $i < 10; ++$i) { echo $…

php loops foreach