哈士奇WWW
第一个条件:const value = '', value1 = '', value2 = '', value3 = '', value4 = '', value5 = '';const condition1 = [ value, value1, value2, value3, value4, value5,].every(x => x === '');console.log(`Condition1 : ${condition1}`);如果您可以将值重构为数组,那就更好了。const values = [ '', '', '', '', '', '',];const condition1 = values.every(x => x === '');console.log(`Condition1 : ${condition1}`);共const value = '', value1 = '', value2 = '', value3 = '', value4 = '', value5 = ''; if ([ value, value1, value2, value3, value4, value5,].every(x => x === '') || value === 'error') { console.log(`Condition : true`);} else { console.log(`Condition : false`);}