【1】 if多条件判断
冗余写法:if( x === ‘a‘ || x === ‘b‘ || x === ‘c‘ || x === ‘d‘ ){ }
优化写法:if( [‘a‘,‘b‘,‘c‘,‘d‘,].includes(x) ){}
js10个优化小技巧
原文:https://www.cnblogs.com/weiyunhong/p/14365470.html