Update append-outside-loop.md

Updated the last example adopting a for loop and length cache. We should recommend how to achieve the best performance.