[Greasemonkey] Basic JavaScript questions

Jeremy Dunck jdunck at gmail.com
Wed Jun 29 20:46:47 EDT 2005


On 6/29/05, Aaron Boodman <zboogs at gmail.com> wrote:
> You have to remember that calculating .length means it has to find
> every single H3 (or whatever). You are doing this on every iteration.
> Not such a great idea. They really ought to name it something like:
> 
> .findAllItemsAndReturnCountSlowly() or something :-)

Well, the implementation could be caching the value and dirtying it on
DOM mutation.  Hey, as long as we're all jumping in.  ;-)


More information about the Greasemonkey mailing list