var pozice = 0; var max = pole[pozice]; for (i = 1; i < pole.length; i++) { if (max < pole[i]) { pozice = i; max = pole[pozice]; } }