At a recent UI/UX MeetUp that I attended, I gave some feedback on a website that used Javascript (jQuery) for its interaction and UI - it was fairly simple animations and manipulation, but the performance on a decent computer was horrific.It actually reminded me of a lot of sites/programs that I've seen with the same issue, where certain actions just absolutely destroy performance. It is mostly in (or at least more noticeable in) situations where Javascript is almost serving as a Flash replacement. This is in stark contrast to some of the webapps that I have used that have far more Javascript and functionality but run very smoothly (COGNOS by IBM is one I can think of off the top of my head).I'd love to know some of the common issues that aren't considered when developing JS that will kill the performance of the site. 
Common Javascript mistakes that severely affect performance?
web development;javascript
A common performance killer is calling .length on an HTMLCollection inside a for loop:function foo(collection) {    for (var index = 0; index < collection.length; index++) {        // do something awesome here    }}That anti-pattern causes the size of the collection to be calculated on each pass through the loop. The better approach is to calculate the length outside the loop:function foo(collection) {    var collectionLen = collection.length;    for (var index = 0; index < collectionLen; index++) {        // do something awesome here    }}