The JavaScript interpreters in the most popular browsers distinguish between sparse and dense arrays. Hence, you may get more “array-like” performance if you initialize an array before using it. But this trades memory for speed, so it may not always be the best choice.
It may well be that for better JavaScript performance, large arrays should be avoided where possible. That seems fairly clear in this case, where an already fast implementation of the missing String.trim() method was made even faster by using much smaller lookup table arrays.
In software engineering, Occam’s Razor has a corollary: When entities are multiplying, find out how they became necessary. An issue in SyntaxHighlighter illustrates this principle.
In my last post, I misstated how to use the new ITextHoverExtension2#getHoverInfo2
interface. Herein, I attempt to set things right(er).