让人抓狂匪夷所思的4组代码
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/
版权声明:
作者:后浪云
链接:https://www.idc.net/help/382007/
文章版权归作者所有,未经允许请勿转载。
THE END