0

Hello

I wish to convert the following jQuery each to fors....This way I can see it a lot clearer....

var draws = this.canvasListener.getDrawManager().getAll();
$j.each(draws, function(index, draw) {

                    var points = draw.getPointManager().getAll();
                        $j.each(points, function(index, point) 
                        {

                        }.bind(this));

                }

Yes, I know "each" is faster and better optimize but I dont care.

What is the equivilent in a for loop?

Thank you

2
Contributors
4
Replies
5
Views
4 Years
Discussion Span
Last Post by riahc3
0
for(var i = 0; i < draws.length; i++) {
    var draw = draw[i];
}

There is another each there; Could you translate it as well?

(I know more or less but I want to be 100% sure

0
for (var i = 0; i < draws.length; i++) {
    var points = draws[i].getPointManager().getAll();
    for (var j = 0; j < points.length; j++) {
        var point = points[j];
    }
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.