A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
How to improve the performance of your for loops |
On Friday, November 2nd 2007 at 02:33 AM By Andrew Pociu (View Profile) ![]() ![]() ![]() ![]() (Rated 3 with 2 votes) |
||
|
Instead of the typical: for(var i=0; i<theArray.length; i++) { // Loop } Use: for(var i=0, arrLen=theArray.length; i<arrLen; ++i ) { // Loop } Because instead of checking the length of the array each loop and comparing it to i, it stores it in a variable arrLen, which is then compared at each loop with i. This saves a few milliseconds, since checking the array length requires slightly more processing power. |
|||
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|||
|
|||
Current Commentsit's very use full for all students'
it's very use full for all students'
Related Knowledge Base Articles
Related Source Code
Related Tutorials
JavaScript Job Search