Kotlin has very nice iterating functions, like forEach or repeat, but I am not able to make the break and continue operators work with them (both local and non-local):...
I just had a quick question regarding loops in Ruby. Is there a difference between these two ways of iterating through a collection? # way 1 @collection.each do |item|...
Is it possible to do following without the i? for i in range(some_number): # do something If you just want to do something N amount of times and don’t...
Suppose I have a loop like this: for (var i = 0; i < SomeArrayOfObject.length; i++) { if (SomeArray[i].SomeValue === SomeCondition) { var SomeVar = SomeArray...
For example, right now I’m using the following to change a couple of files whose Unix paths I wrote to a file: cat file.txt | while read in; do...
I’m using Pry with my Rails application. I set binding.pry inside a loop in my model to try and debug a problem. For example: (1..100).each do |i| binding.pry puts...
I’ve heard this quite a few times. Are JavaScript loops really faster when counting backward? If so, why? I’ve seen a few test suite examples showing that reversed loops...
So I want to iterate for each character in a string. So I thought: for (char c : "xyz") but I get a compiler error: MyClass.java:20: foreach not applicable...
I’m not even sure how to do this without using some horrible for loop/counter type solution. Here’s the problem: I’m given two dates, a start date and an end...
Go’s range can iterate over maps and slices, but I was wondering if there is a way to iterate over a range of numbers, something like this: for i...