让人抓狂匪夷所思的4组代码

1.确保这个值等于ture

 
 
 
  1. if (someBoolean == true) {  
  2. doSomething();  

2.只有等于ture时我才return ture

 
 
 
  1. if (result == true)  
  2. return true;  
  3. else 
  4. return result; 

3.我就是不信任if

 
 
 
  1. if (result <= 10) {  
  2. handling();  
  3. }  
  4. else if (result > 10) {  
  5. otherHandling();  
  6. }  
  7. else {  
  8. handling(); // to be sure  

4.要写出一看就懂的代码

 
 
 
  1. function DocumentDotWrite(s){  
  2. document.write(s);  

原文链接:http://www.aqee.net/horrible-code/


网站题目:让人抓狂匪夷所思的4组代码
新闻来源:http://zjjierui.cn/article/dhpjdde.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款