So today I went searching for a trim() method in JavaScript. Much to my suprise, one didn’t exist. We actually had one locally that another developer had written, but it was only trimming whitespace (no optional argument to trim a certain character). So today, I went ahead and wrote one.
Update: I adjusted the methods to be standalone as well as string prototypes and added some constants from the base trim method.