Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8163111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:56:52+00:00 2026-06-06T18:56:52+00:00

Trailing commas in JavaScript object literals are not accepted as a valid JavaScript syntax

  • 0

Trailing commas in JavaScript object literals are not accepted as a valid JavaScript syntax by IE7 :

var a = {
  foo: 12,
  bar: 13,//this is ok in all browsers except ie7
};

For the moment the way I deal with this issue is to open my website using IE7 and use the console to find the invalid js files.

Do you know how to locate (or even better remove) trailing commas in a javascript file using UNIX command line ?

I tried to grep these commas but a multiline regex is needed. I also googled the subject and found nothing useful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:56:53+00:00Added an answer on June 6, 2026 at 6:56 pm

    JSHint can find those for you. You can download it and run it from the command line. It also has lots of useful additional things it can check for you (and options to turn the ones off that you don’t want).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When working with object literals in JavaScript, I find myself frequently generating syntax issues
I am wondering if a comma trailing an array in javascript is valid? var
Are there any Python JSON parsers that will cope with trailing commas? (I'm consuming
I have a trailing object following after the mouse. When the mouse gets out
I would like to remove all trailing zeros without truncating or rounding the number
I need to trim all the trailing white spaces from the text elements of
In most Node.js libraries people take special care removing trailing commas after the last
I think its the cause of trailing comma, or syntax error, variable used without
I have a javascript code, containing an array with trailing comma items:[{ id: 'col-1',
I have a rails template (.rhtml file) generating a Javascript object. It looks something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.