【发布时间】:2011-02-28 10:12:34
【问题描述】:
此代码修剪空白,(仅供参考:它被认为非常快)
function wSpaceTrim(s){
var start = -1,
end = s.length;
while (s.charCodeAt(--end) < 33 ); //here
while (s.charCodeAt(++start) < 33 ); //here also
return s.slice( start, end + 1 );
}
while 循环没有括号,我如何正确地在这段代码中添加括号?
while(iMean){
// like this;
}
非常感谢!
【问题讨论】:
标签: javascript readability semantics