Top "Foreach" questions

foreach is a looping construct that executes a given piece of code for each element in a list/collection/array.

Remove Element from Set

I'm trying to remove all Strings that are of even length in a set. Here is my code so far, …

java string foreach set string-length
How to Iterate through HashMap in MyBatis foreach?

I'm trying to produce a sql which is as below in mybatis. SELECT COL_C FROM TBLE_1 WHERE (COL_A, …

java sql foreach mybatis
Why is there no forEach method on Object in ECMAScript 5?

ECMAScript 5's array.forEach(callback[, thisArg]) is very convenient to iterate on an array and has many advantage over the …

javascript foreach ecmascript-5
What is the difference between .map, .every, and .forEach?

I've always wondered what the difference between them were. They all seem to do the same thing...

javascript foreach map-function
Declaring a variable inside or outside an foreach loop: which is faster/better?

Which one of these is the faster/better one? This one: List<User> list = new List<User&…

c# foreach
How can I make my class iterable so I can use foreach syntax?

I have Book and BookList classes. BookList is something like this: public class BookList { private final List<Book> …

java foreach iterable
How do I break multiple foreach loops?

I have four foreach loops that iterate through the collections and based on a condition do something. Here is the …

java refactoring foreach
Display current post custom taxonomy in WordPress

I've created custom taxonomies on WordPress and I want to display the current post taxonomies on the post in a …

php wordpress foreach taxonomy custom-taxonomy
Foreach loop in jade (node.js template engine)

Ok, I am getting an associative array from node server and trying to render it in Jade. I obviously need …

node.js foreach associative-array pug
How do you find the last loop in a For Each (VB.NET)?

How can I determine if I'm in the final loop of a For Each statement in VB.NET?

vb.net foreach for-loop each