[arrays] Modify iterators for better speed.

- along the lines decided for the foreach
[doc] Update array doc.