Should also remove \uffef, in case it's a big-endian string.

Although, you should probably rewrite this to just chop off the first character, like so:

```javascript
if (str.charCodeAt(0) === 0xfeff || str.charCodeAt(0) === 0xffef) {
  str = str.substring(1);
}
return str;
```

Otherwise str.replace will go looking throughout the string for the BOM and replace the first one it finds, even if it's not a the beginning. And if the string does NOT include the BOM, the str.replace call will have to traverse the entire string before giving up.