Why leave a trailing comma after a key value pair in an object literal?
问题 I was looking at gruntjs and I looked at some JSON examples used to configure Grunt tasks. Here is an example of the JSON: grunt.initConfig({ concat: { foo: { // concat task "foo" target options and files go here. }, bar: { // concat task "bar" target options and files go here. }, }, uglify: { bar: { // uglify task "bar" target options and files go here. }, }, }); As you can see, there is an 'extra' comma after each of the bar properties. I tried this notation in Chrome and it is valid.