Why not `for (k = 0, k < spaces.length; k++)` ?