var a = '123';
var b = (a === 'cpa' ? 'cpa' : (a === 'cps') ? 'cps' : 'flow');
console.log('b', b); // b flow
三元表达式
最新推荐文章于 2024-04-11 15:48:32 发布
var a = '123';
var b = (a === 'cpa' ? 'cpa' : (a === 'cps') ? 'cps' : 'flow');
console.log('b', b); // b flow