var i = 0; var pozice = -1; while (i < pole.length) { if (hledane == pole[i]) { pozice = i; break; } i++; }