好的js书写习惯
作者:互联网
1:单一判断
bad
if (result) { console.log("秋叶"); } if (!result) { console.log("秋叶"); }
good
result && console.log("秋叶"); result || console.log("秋叶");
2:定义多个变量
bad
var a = "aa"; var b = "bb"; var c = "cc";
good
var a = "aa", b = "bb", c = "cc";
标签:aa,console,log,书写,习惯,js,result,var,秋叶 来源: https://www.cnblogs.com/wxydemo/p/12077146.html