让人抓狂匪夷所思的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://www.shufengxianlan.com/qtweb/news41/422241.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联