十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
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);
- }
原文链接:http://www.aqee.net/horrible-code/