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 6932463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:42:33+00:00 2026-05-27T11:42:33+00:00

I just ran one script through JSlint and received tons of errors – all

  • 0

I just ran one script through JSlint and received tons of errors – all related to the example below. Now I need to clear some basics, as I’m honestly pretty new to JS and don’t know if those are “critical” Errors, Warnings or notices.

var whatEver = {
    foo:         null,
    fooArray:    [],
    // This tells me that the curly bracket was expected much earlier
    barArray:
    {
         whatever:    'somestring'
        ,keyTwo:      'anotherstring'
    },
    // Here I get told that I got "wrong" white spaces
    bar:         document.getElementById( 'someID' )
};

I know most of this is “basic” js stuff and so far everything’s working fine. I just want to know if I’m making basic mistakes.

Thanks.

  • 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-05-27T11:42:34+00:00Added an answer on May 27, 2026 at 11:42 am

    Here is some feedback:

    1. It’s not that normal to have a lot of whitespace after property names. Maybe it’s a copy/paste problem.
    2. Objects as shown by the {} are not arrays, FYI. SO you might not wants to call them arrays. You can make an array literal by using [], if that’s what you want.
    3. document.getElementById( ‘someID’ ); should NOT have a semi-colon at the end. That’s your biggest mistake.
    4. You sometimes use comma-before syntax and sometimes use comma-after. You could probably just stick with one. Personally, most of my JS is in node and comma-before is pretty normal there. Either works though. http://css-tricks.com/7741-commas-before/
    5. I put this in my code example, but didn’t mention it up here. Braces should always be on the line with the parent. This is because of automatic semi-colon insertion, which can screw you up if you put a return on the line before {}. See: http://robertnyman.com/2008/10/16/beware-of-javascript-semicolon-insertion/. Thanks Michael for mentioning it below!

    Here’s what I’d go with. http://jsfiddle.net/n87Cn/ JSLINT doens’t like it, but I think it’s quite nice.

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

Sidebar

Related Questions

I just ran a perl script to replace all occurances of one word for
I just ran a PROCEDURE ANALYSE ( ) on one of my tables. And
All files seems to have run through the build script without any problems except
I just ran into the user-defined conversions to or from an interface are not
I just ran into an issue with Python's imaplib and Gmail's authentication mechanism: >>>
I just ran across the following error: (.gnu.linkonce.[stuff]): undefined reference to [method] [object file]:(.gnu.linkonce.[stuff]):
I just ran across this error message while working in C# A property or
I just ran into some code that overuse semicolons, or use semicolon for different
I just ran into a problem with the version of JAX-WS in JDK 1.6.0
I just ran across a question with an answer suggesting the AntiXss library to

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.