Thanks for your posting and considering Aspose APIs.
It seems your question is not related to Aspose APIs but it is relating to programming tutorials and you want to learn how for loop or while loop or do loop works. Let us know if we understood you wrong and clarify your issues or queries with further details.
If you want to know about programming, there are lots of material available on internet. Please google it yourself.
( http://www.w3schools.com/js/js_loop_for.asp )