var myObject = { foo:'foo', bar:'bar', //no error }; var myArray = [1,2,3,]; console.log(myArray.length) //logs 3, regardless of trailing comma