See console... "replace-and-callback" may look faster than "replace-in-loop" but acutally they are almost the same. In fact, "replace-and-callback" could run slower thatn "replace-in-loop" because in "replace-and-callback", the callback function gets called on every value in an array. If the input is UTF-8, then it's easier to split a string into UTF-8 characterss in "replace-and-callback". Maybe that is the only advantage of "replace-and-callback"