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

for(var i = 0; i < draws.length; i++) {
    var draw = draw[i];
}
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

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];
    }
}

Thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.