Javascript Foreach Loop Through Array Backwards Question