News for hackers. Stuff that matters.
Re:A Gentle Introduction to Algorithm Complexity Analysis by strainer on Friday June 15, 2018 @08:56AM (#17319403)

    for ( var i=0; i<n; ++i ) {..
In Javascript this will loop from 0 to n-1 inclusive regardless of using ++i or i++, because that loop 'stepping statement' happens after the loop body.

Its possible to combine the step in the test to go from 1 to n-1

    for ( var i=0; ++i<n; ) {..
best to be aware of the quirk and just do

    for ( var i=1; i<n; i++ ) {..

There are no comments on this comment yet.