in reply to strange comma

I personally prefer to shy away from the extra comma. I do this expressly because the majority of the perl programming that I do is in a web environment. As 'Your Mother' has pointed out, some javascript engines allow the extra comma and others do not. If you have in an environment where you switch between javascript and perl freely, this kinda of thing can be a major headache. If you get in the habit of leaving the extra comma, you are more likely to do so in the javascript snippets. This is all well and good under mozilla (which you are probably developing with if your a LAMPer), but internet explorer will barf everywhere over the extra comma. I once spent well over an hour on this "syntax error" that basically equated to a difference in the grammars.
¥peace from CaMelRyder¥

Replies are listed 'Best First'.
OT: strange leading comma
by Your Mother (Archbishop) on Jun 29, 2010 at 16:48 UTC

    I definitely understand. This is why I have taken to this style for JS (and SQL)-

    $.ajax({ url: "test.html" ,context: document.body ,success: function(){ $(this).addClass("done"); } });

    It's a bit weird at first but it makes yanks and pastes and edits easier and harder to mess up.