options.async=options.async.toLowerCase()=='false'?false:true;在phpstorm有个报错 'options.async.toLowerCase()=='false'?false:true' can be simplified to
'options.async.toLowerCase()!='false'' 更少...
(Ctrl+F1)This inspection reports any instances of JavaScript conditional
expressions of the form condition?true:false
or condition?false:true.
These expressions may be safely simplified to condition
or !condition , respectively. 所以随便问
1 回答
已采纳
习惯受伤
TA贡献885条经验 获得超1144个赞
能,options.async=options.async.toLowerCase()=='false'?false:true;你这句的意思就是,当值等于false时,返回false,那么好了,当值不等于false时返回true,那么可以优化成:options.async=options.async.toLowerCase()!='false';
添加回答
举报
0/150
提交
取消