How to I correctly add brackets to this code
Posted
by Mohammad
on Stack Overflow
See other posts from Stack Overflow
or by Mohammad
Published on 2010-06-06T16:55:52Z
Indexed on
2010/06/06
17:02 UTC
Read the original article
Hit count: 225
This code removes whites paces, (fyi: it's credited to be very fast)
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 );
}
The while loops don't have brackets, how would i correctly add brackets to this code?
while(iMean){
like this;
}
Thank you so much!
© Stack Overflow or respective owner