Different tasks call for different conventions. At least, that’s the excuse some people use for switching between 0-based and 1-based array indexes. That still doesn’t explain why Phillip’s co-worker did this.

var panelIndexes = {  
   "1" : 0,  
   "2": 1,  
   "3": 3,  
   "4": 4,  
   "5": 5,  
   "6": 6,  
   "7": 7,  
   "8": 8,  
   "10": 9,  
   "11" : 2,  
   "12" : 10 //Don't ask  
};
/* snip */  
var activePanel = panels[panelIndexes[i]];

It says, “Don’t ask,” and I think I’ll take that advice.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!