Expected ‘===‘ and instead saw ‘==‘ (eqeqeq)
用sourceTree提交VUE代码Expected ‘=’ and instead saw '’ (eqeqeq) at…var a = 1;var b = '1';if(a == b){console.log("true");}else{console.log("false");}结果:true--------------------------------------------------
·
用sourceTree提交VUE代码
Expected ‘=’ and instead saw '’ (eqeqeq) at…
var a = 1;
var b = '1';
if(a == b){
console.log("true");
}else{
console.log("false");
}
结果:true
---------------------------------------
---------------------------------------
var a = 1;
var b = '1';
if(a === b){
console.log("true");
}else{
console.log("false");
}
结果:false
原因是因为’==‘和’!='会强制进行类型转换
但是我现在的需求有些时候要用到’==‘和’!=’
解决方法
找到图中的文件并打开 将rules下面的eqeqeq设置为'eqeqeq': ["off"],
更多推荐
已为社区贡献1条内容
所有评论(0)