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.

Is it bad practice to use break to exit a loop in Java?

I was wondering if it is a "bad practice" to use a break statement to exit a loop instead of …

java loops jvm break
Iterating through a golang map

I have a map of type: map[string]interface{} And finally, I get to create something like (after deserializing from …

map go loops
Write a method to print out a string "Name" multiple times

I am answering a question for an Intro to Programming class and cannot - after reading through my notes, Big …

java string loops accumulator
Changing objects value in foreach loop?

In one place i am using the list of string in that case the i am able to change the …

c# loops foreach enumeration
Looping through localStorage in HTML5 and JavaScript

So, I was thinking I could just loop through localStorage like a normal object as it has a length. How …

javascript html loops object local-storage
JavaScript: Difference between .forEach() and .map()

I know that there were a lot of topics like this. And I know the basics: .forEach() operates on original …

javascript arrays loops foreach
Checking if array is multidimensional or not?

What is the most efficient way to check if an array is a flat array of primitive values or if …

php arrays loops multidimensional-array element
Ignoring an error message to continue with the loop in python

I am using a Python script for executing some function in Abaqus. Now, after running for some iterations Abaqus is …

python loops error-handling abaqus
Populate PHP Array from While Loop

If I am fetching data from a MySQL database and using a while loop to iterate through the data how …

php mysql arrays loops while-loop
Looping through files in a folder Node.JS

I am trying to loop through and pick up files in a directory, but I have some trouble implementing it. …

javascript arrays node.js loops fs