> var fetcher = 0; >>for this to start with 1:
> hold[hold.length] = this["prCtr" + fetcher++]; // love this writing! >I don't think so
>>item.hasDuplicateCenters = function(){ >> >> var fetcher = 1; >> var hold = new Array(); >> while (this.hasOwnProperty("prCtr" + fetcher)) >> hold[hold.length] = this["prCtr" + fetcher++]; >> >> hold.sort(); >> >> for (var index = hold.length - 1; index > 0; index--){ >> if (hold[index] != 0){ >> if (hold[index] === hold[index - 1]) return true; >> } else return false; >> } >> >> return false; >>} >> >>if (item.hasDuplicateCenters()) errorMsg = resourceFactory.getResource('Messages', 'allDifferentProfitCenters') >>