map,表,优化,优化的是什么:重复的if,else
if(a){1}else if(b){2}else if(c){3}else if(d){4}else if(e){5}else if(f)6{}
优化
const map=[a:1,b:2,c:3,d:4,e:5,f:6]function Q(key){return map[key]}const A=Q(a)
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号