var index = arrPrice.findIndex(el => el[0] == 'Адлер');
var arr = ['comfort','business','miniven','bus']; arr.forEach(function(el){ $('#'+el+'show').click(function(){ $('#'+el+'container').show(); arr.forEach(function(elt){ if(elt!=el)$('#'+elt+'container').hide(); }); }); });