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)
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!