The conditional operator and destructuring can do this:
const [dogStatus, catStatus, fishStatus] = present ? ['bark', 'meow', 'blub'] : ['beep', 'meep', 'bleeboop'];
For the sake of code organization, I'd strongly consider if having just a single variable instead of multiple standalone variables would be possible, I'd prefer it in most situations:
const status = present
? { dog: 'bark', cat: 'meow', fish: 'blub' }
: { dog: 'beep', cat: 'meep', fish: 'bleeboop' };
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…