We should use forEach to iterate a list
See original GitHub issueSee git grep 'for (' src contribs/gmf/src|grep -v forEach|grep -v ' in '|grep length
:
contribs/gmf/src/directives/displayquerygrid.js: for (var ii = 0; ii < features.length; ii++) {
contribs/gmf/src/directives/displayquerygrid.js: for (i = 0; i < allProperties.length; i++) {
contribs/gmf/src/directives/displayquerywindow.js: for (i = 0; i < sources.length; i++) {
contribs/gmf/src/directives/displayquerywindow.js: for (var i = 0; i < sources.length; i++) {
contribs/gmf/src/directives/displayquerywindow.js: for (var ii = 0; ii < features.length; ii++) {
contribs/gmf/src/directives/elevation.js: for (var i = 0, ii = this.listenerKeys_.length; i < ii; ++i) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < children.length; i++) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < nodes.length; i++) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < childNodes.length; i++) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < layers.length; i++) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < nodeLayers.length; i++) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < layersNames.length; i++) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < layersNames.length; i++) {
contribs/gmf/src/directives/layertree.js: for (i = 0; i < nodeNames.length; i++) {
contribs/gmf/src/directives/search.js: for (var i = 0; i < this.datasources_.length; i++) {
contribs/gmf/src/directives/search.js: for (var i = 0, ii = actions.length; i < ii; i++) {
contribs/gmf/src/services/permalink.js: for (var i = 0, len = layers.length; i < len; i++) {
contribs/gmf/src/services/querymanager.js: for (var i = 0, len = themes.length; i < len; i++) {
contribs/gmf/src/services/querymanager.js: for (var i = 0, len = backgroundLayers.length; i < len; i++) {
contribs/gmf/src/services/querymanager.js: for (var i = 0, len = children.length; i < len; i++) {
contribs/gmf/src/services/themesservice.js: for (var i = 0, ii = themes.length; i < ii; i++) {
contribs/gmf/src/services/themesservice.js: for (var j = 0, jj = theme.children.length; j < jj; j++) {
contribs/gmf/src/services/themesservice.js: for (var k = 0, kk = group.children.length; k < kk; k++) {
contribs/gmf/src/services/themesservice.js: for (var i = 0, ii = themes.length; i < ii; i++) {
contribs/gmf/src/services/themesservice.js: for (var j = 0, jj = theme.children.length; j < jj; j++) {
src/directives/sortable.js: for (var i = 0; i < children.length; ++i) {
src/ol-ext/format/featurehash.js: for (var i = 0; i < styles.length; ++i) {
src/ol-ext/format/featurehash.js: for (var i = 0, ii = lineStrings.length; i < ii; ++i) {
src/ol-ext/format/featurehash.js: for (var i = 0, ii = rings.length; i < ii; ++i) {
src/ol-ext/format/featurehash.js: for (var i = 0, ii = polygons.length; i < ii; ++i) {
src/ol-ext/format/featurehash.js: for (var j = 0, jj = rings.length; j < jj; ++j) {
src/ol-ext/format/featurehash.js: for (var i = 0; i < parts.length; ++i) {
src/ol-ext/format/featurehash.js: for (var i = 0; i < parts.length; ++i) {
src/ol-ext/format/featurehash.js: for (var i = 0, ii = features.length; i < ii; ++i) {
src/ol-ext/format/xsdattribute.js: for (var i = 0, ii = elements.length; i < ii; i++) {
src/ol-ext/format/xsdattribute.js: for (var i = 0, ii = enumerations.length; i < ii; i++) {
src/ol-ext/interaction/measure.js: for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {
src/ol-ext/interaction/modifycircle.js: for (var i = nodesToRemove.length - 1; i >= 0; --i) {
src/ol-ext/interaction/modifycircle.js: for (j = 0, jj = rings.length; j < jj; ++j) {
src/ol-ext/interaction/modifycircle.js: for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
src/ol-ext/interaction/modifycircle.js: for (var i = 0, ii = segmentDataMatches.length; i < ii; ++i) {
src/ol-ext/interaction/modifycircle.js: for (var i = 1, ii = nodes.length; i < ii; ++i) {
src/ol-ext/interaction/modifyrectangle.js: for (var i = 0; i < corners.length; i++) {
src/services/print.js: for (var i = 0, ii = matrixIds.length; i < ii; ++i) {
src/services/print.js: for (var i = 0, ii = features.length; i < ii; ++i) {
src/services/print.js: for (var j = 0, jj = styles.length; j < jj; ++j) {
src/services/printutils.js: for (var i = 0, ii = printMapScales.length; i < ii; ++i) {
src/services/query.js: for (var i = 0, len = ids.length; i < len; i++) {
src/services/query.js: for (var i = 1, len = items.length; i < len; i++) {
src/services/statemanager.js: for (i = 0; i < keys.length; ++i) {
src/services/syncarrays.js: for (i = arr1.length - 1, j = 0; i >= 0; --i) {
src/services/syncarrays.js: for (i = 0, ii = arr1.length, j = 0; i < ii; ++i) {
src/services/syncarrays.js: for (i = 0, ii = arr1.length, j = arr2.length - 1; i < ii; ++i) {
src/services/syncarrays.js: for (i = 0, ii = arr1.length, j = 0; i < ii; ++i) {
src/services/toolActivateMgr.js: for (var i = 0; i < entries.length; i++) {
src/services/toolActivateMgr.js: for (var i = 0; i < entries.length; i++) {
src/services/toolActivateMgr.js: for (var i = 0; i < entries.length; i++) {
src/services/toolActivateMgr.js: for (var i = 0; i < entries.length; i++) {
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
How to Use forEach() to Iterate an Array in JavaScript
forEach () is best used to iterate array items, without breaking, and having simultaneously some side-effect. Side-effects examples are a ...
Read more >JavaScript Array.forEach() Tutorial – How to Iterate ...
In JavaScript, you'll often need to iterate through an array collection and execute a callback method for each iteration.
Read more >Iterator vs Foreach In Java
Traversing a collection using for-each loops or iterators give the same performance. Here, by performance we mean the time complexity of both ...
Read more >Array.prototype.forEach() - JavaScript - MDN Web Docs
The forEach() method is an iterative method. It calls a provided callbackFn function once for each element in an array in ascending-index order....
Read more >Guide to the Java 8 forEach
Any iterable of type Collection — list, set, queue etc. — has the same syntax for using forEach. Therefore, as we have seen,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
IMO we should not require the use of
forEach
.OK, then I close it…