Why I’m The Best Programmer In The World* (Javascript)

Grr… took me like 20 minutes to find this bug >.< at least I’m better than I was a year ago.

var coordinates = data.documentElement.getElementsByTagName("coordinates");
for ( var i = 0; i < coordinates.length; i++) {
  var value = coordinates[i].firstChild.textContent.split("\n");
  var track = [];
  for(var x=0; i < value.length; x++) {
    //Loop doesn't die!!
  }
}

See it? The 2nd condition was true whenever the 1st was true… I <3 programming.

* Yes, the title is intended to be ironic

Comments (View)

Comments powered by Disqus