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/
网站栏目:让人抓狂匪夷所思的4组代码
标题网址:http://www.kswsj.com/qtweb/news41/422241.html
网站建设、网络推广公司-成都快上网,一家网站设计、网站制作公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 成都快上网