歡迎您光臨本站 註冊首頁

讓人抓狂的代碼

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  

 1.確保這個值等於ture

  if (someBoolean == true) {      doSomething();  }    

2.只有等於ture時我才return ture

  if (result == true)      return true;  else      return result;  

3.我就是不信任if

  if (result <= 10) {      handling();  }  else if (result > 10) {      otherHandling();  }  else {      handling(); // to be sure  }  


4.要寫出一看就懂的代碼

  function DocumentDotWrite(s){      document.write(s);  }


[火星人 ] 讓人抓狂的代碼已經有386次圍觀

http://coctec.com/docs/program/show-post-71327.html