Note 1: The comparison is based on trimming the Magna Carta (over 27,600 characters) with a bit of leading and trailing whitespace 20 times on my personal system. However, the data you're trimming can have a major impact on performance, which is detailed below. Note 2: trim4 and trim6 are the most commonly found in JavaScript libraries today. Note 3: The aforementioned bad implementation is not in