ssamuel68

13 Sep 2013, 12:12 PM

Hi,

I know they are several functions on javascript for looping.

Ext.each is one provided for Sencha. I want to know what is the plain JS equivalent.

On this page I found a benchmark for loop functions: http://jsperf.com/fors-vs-while/58

F (http://jsperf.com/fors-vs-while/58)or example:

values.forEach(add);

for (i = 0; i < values.length; i++) {

add(values[i]);

}

var i = 0,

n = values.length;

while (i < n) {

sum += values[i++];

}So, which one of this are the Ext.each equivalent?

Thx.

I know they are several functions on javascript for looping.

Ext.each is one provided for Sencha. I want to know what is the plain JS equivalent.

On this page I found a benchmark for loop functions: http://jsperf.com/fors-vs-while/58

F (http://jsperf.com/fors-vs-while/58)or example:

values.forEach(add);

for (i = 0; i < values.length; i++) {

add(values[i]);

}

var i = 0,

n = values.length;

while (i < n) {

sum += values[i++];

}So, which one of this are the Ext.each equivalent?

Thx.