addyosmani/todomvc — comment on commit 6bfa658c1e5e9cf49c5cf64ec1b2c2eb6f385a29
File: architecture-examples/knockoutjs/js/app.js line 81
By sindresorhus:

Use the native .trim() method instead of the regex, and just include a polyfill for older browsers.

```javascript
if(!String.prototype.trim) {
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g,'');
};
}
```