function well(x){ let {length} = x.filter(a => a == 'good'); return length > 2 ? 'Very good' : length ? 'Good!' : 'bed' } alert(well(['good', 'good', 'good', 'gg', 'rr', 'good', 'good']))