Steve has gotten interesting research which is making trim method and optimizing internal to JavaScript.
These are codes.
function trim11 (str) {
str = str.replace(/^\s+/, ”);
for (var i = str.length – 1; i > 0; i–) {
if (/\S/.test(str.charAt(i))) {
[...]
Posts Tagged ‘JavaScript’
Faster JavaScript Trim
Posted in JavaScript, tagged JavaScript, Optimization, trim on March 21, 2008 | Leave a Comment »


