title: JSON Remove trailiing comma from last object
body: <p>This JSON data is being dynamically inserted into a template I'm working on. I'm trying to remove the trailing comma from the list of objects. </p>
  
  <p>The CMS I'm working in uses Velocity, which I'm not too familiar with yet. So I was looking to write a snippet of JavaScript that detects that trailing comma on the last object (ITEM2) and removes it. Is there a REGEX I can use to detect any comma before that closing bracket? </p>
  
  <pre><code>[  
     {  
        "ITEM1":{  
           "names":[  
              "nameA"
           ]
        }
     },
     {  
        "ITEM2":{  
           "names":[  
              "nameB",
              "nameC"
           ]
        }
     }, // need to remove this comma!
  ]
  </code></pre>