Top "Iteration" questions

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

Iterate over two arrays simultaneously

I am new to Swift. I have been doing Java programming. I have a scenario to code for in Swift. …

arrays swift iteration
Map an array modifying only elements matching a certain condition

In Ruby, what is the most expressive way to map an array in such a way that certain elements are …

ruby map iteration collect
Design patterns for converting recursive algorithms to iterative ones

Are there any general heuristics, tips, tricks, or common design paradigms that can be employed to convert a recursive algorithm …

algorithm recursion iteration heuristics
Iteration (for loop) in sightly

I had used <c:forEach> in jstl. Now i want to use sightly. My usecase is to print …

for-loop iteration aem sightly
Prolog-iterating through list

Let's say i have list Xs = [a,b,c]. Now i want to iterate through all elements and call another …

list prolog iteration head
Iterating through the Alphabet - C# a-caz

I have a question about iterate through the Alphabet. I would like to have a loop that begins with "a" …

c# count loops iteration alphabet
Iteration over list slices

I want an algorithm to iterate over list slices. Slices size is set outside the function and can differ. In …

python loops iteration slice
How to iterate through a Hashmap, print the key/value and remove the value in Rust?

This should be a trivial task in any language. This isn't working in Rust. use std::collections::HashMap; fn do_…

hashmap rust iteration mutability
In Rust, is there a way to iterate through the values of an enum?

I come from a Java background and I might have something like enum Direction { NORTH, SOUTH, EAST, WEST} and I …

enums iteration rust
How to iterate through an Object attributes in Angular 2

Here's my object (It has n number of dynamic keys. I've only shown two in the example below) let obj = { …

javascript loops angular iteration ngfor