Tag: each

57 votes
16 answers
2.6K views
Update all objects in a collection using LINQ

Is there a way to do the following using LINQ? foreach (var c in collection) { c.PropertyToSet = value; }

avatar
Robyn
0 1 0 9
asked 07 September, 2021
60 votes
22 answers
2.8K views
LINQ equivalent of foreach for IEnumerable<T>

I'd like to do the equivalent of the following in LINQ, but I can't figure out how: IEnumerable<

avatar
Yolando
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
2.7K views
How can I check for an active Internet connection on iOS or macOS?

I would like to check to see if I have an Internet connection on iOS using the Cocoa Touch libraries or on mac

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
56 votes
7 answers
2.3K views
"continue" in cursor.forEach()

I'm building an app using meteor.js and MongoDB and I have a question about cursor.forEach(). I want to c

avatar
Suzan
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
1K views
How do I loop through or enumerate a JavaScript object?

I have a JavaScript object like the following: var p = { "p1": "value1", "p2": "value2", "p3": "v

avatar
Santiago
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
955 views
For-each over an array in JavaScript

How can I loop through all the entries in an array using JavaScript? I thought it was something like this: f

avatar
Cortez
0 1 0 9
asked 07 September, 2021
69 votes
7 answers
1.9K views
How does PHP &apos;foreach&apos; actually work?

Let me prefix this by saying that I know what foreach is, does and how to use it. This question concerns how i

avatar
Leonardo
0 1 0 9
asked 07 September, 2021