this is fine, but note that all modern JS engines will do the length hoisting automatically in simple loops like this