I am wondering if a comma trailing an array in javascript is valid?
var settings = {
\'foo\' : oof,
\'bar\' : rab,
};
vs
With regards to object literals at least (the question's title mentions array, but the example is an object literal) it depends on where your js is running. Trailing commas in object literals are valid in ES5. Although trailing commas can cause problems on the web (in IE) most minifiers will remove them anyway.
http://www.2ality.com/2011/06/object-literal-comma.html
http://dontkry.com/posts/code/trailing-commas.html