JavaScript debugging trick

In order to integrate Todoist into Gmail I had to figure out how Gmail data structure worked. This really isn't that simple, since every variable and object in Gmail is compressed to two characters.

It's painful to use alert as debug mechanism in loops (since you have to press "ok" every time). One can fix this by using confirm, where one can cancel the loop:

for(var obj in objects)
   if(!confirm(obj)) break;

Instead of:

for(var obj in objects)
   alert(obj);

It's a little tip, but kind of nifty.

Code · JavaScript 23. Apr 2007
© Amir Salihefendic. Powered by Skeletonz.