1

Expected identifier, string or number

Posted January 26th, 2009 in javascript and tagged , , by Michael

A very interesting but kept me busy now for quite some time, the following code does not work in IE:

var list = ["a", "b", "c", ];

As the code has been way more complex it was a bit harder to find the extra comma at the end and interestingly I already read about this a while ago… shame on me!

Nevertheless the error message is scary and useless:

IE6, please leave now!

One Response so far.

  1. Dennis says:

    That’s a bit dumb that IE complains about that. It’s common for developers to leave a comma in the end of the array just in case they need to add something later, usually only with large arrays. I guess IE thinks it’s a bad habit.

Leave a Reply