Below is a chunk of some switch code used to create an array of objects which should be visible.  Previously I combined case -1 and case 0 to reduce redundancy, but I am wondering if this code can be reduced in size and/or improved in readability.var visibles = [];switch (hrdid) {    case -1:    case 0:        if (row(tcd)) {            visibles = ['lc', 'ts2', 'rtc', 'ctb'];            if (row(cbr)) visibles.push('ccb2');        } else {            visibles = ['lc1', 'tc', 'rc', 'ico', 'ccb'];        }        if (hrdid == 0) visibles.push('bcf');        if (hrdid == -1) {            visibles.push('bcfa');            visibles.push('cpma');        }        break;    //case 1, etc...}
Creating an array of visible objects
javascript
var visibles = [];function mainWork () {        if (row (tcd)) {            visibles = ['lc', 'ts2', 'rtc', 'ctb'];            if (row(cbr)) visibles.push ('ccb2');        } else {            visibles = ['lc1', 'tc', 'rc', 'ico', 'ccb'];        }}switch (hrdid) {    case -1:       mainWork ();       visibles.push ('bcfa');       visibles.push ('cpma');       break;    case 0:        mainWork ();        visibles.push ('bcf');         break;    //case 1, etc...}