for (var j:int; j < length; j++) { item = array[j]; if (j < length && array.indexOf(item + 1) == -1) { trace('good', item + 1); } }