Good Old And Common JavaScript Errors
... I won't write any introduction, but I'll let you comment, OK? for loops (plus ++i) for(i = 0; i < 10; i++){} // global i defined for(var i = 0; i < something.length; i++){} // cache the length if it won't change during the loop // associate once only under certain conditions to speed up for(var i = 0; i < 10; ++i) {} // there is absolutely nothing wrong in above loop Few people told me something like: " doode, if you use ++i at the end you need to write i < 11 'cause i will be 1 inside the loop " ... basically the for loop has been rarely understood, let me try again: // directly from C language, 1972 for( // optional inline declaration, coma accepted for more vars ; // optional condition to verify // if undefined, it loops until a break is encountered // this condition is performed BEFORE the first loop // if false, the loop will never be executed ; // optional POST operation, it will never be executed // if