generic-github-user / Caesium

General-purpose AI library with NEAT-style genetic algorithm.
https://generic-github-user.github.io/Caesium/src/versions/javascript/projects/network-visualization/
MIT License
1 stars 1 forks source link

Remove forEach loops #96

Closed generic-github-user closed 5 years ago

generic-github-user commented 5 years ago

forEach loops have caused some bugs and issues with the JavaScript Caesium library code. They should be removed . . .

array.forEach(
      (element) => {
            element.doSomething();
      }
);

. . . and replaced with for loops:

for (var i = 0; i < array.length; i++) {
      array[i].doSomething();
}

This will help to improve code compactness and consistency.