Don't accidentally leave a trailing comma in an object definition literal or IE will fail and you won't notice until much later because you never use IE for development and by then it could suck figuring out what happened.
var foo = {
bar: "bar",
baz: "baz",
};
Note @JulianR's comment:
In arrays, IE doesn't fail directly by throwing some syntax error, but will fail when you try to use the array because the added comma makes IE think there's one more element in the array, with value undefined
, than there actually is. So if you ever have an error because for some reason the last element in an array is undefined
: it's a comma.