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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:41:26+00:00 2026-05-25T02:41:26+00:00

Possible Duplicate: Why avoid increment ("++") and decrement ("–") operators in JavaScript? I’ve recently

  • 0

Possible Duplicate:
Why avoid increment ("++") and decrement ("–") operators in JavaScript?

I’ve recently been running all my javascript through JSLint and it always gives me Unexpected '++' on my increment operators. I’ve also noticed there is a JSLint option to tolerate ++/–.

Is it considered bad form to use i++/i--?

  • 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-25T02:41:26+00:00Added an answer on May 25, 2026 at 2:41 am

    If I understand correctly, the reason it’s in JSLint is because there’s a significant difference between ++i and i++, and many developers don’t necessarily appreciate the implications of being specific about when the addition is done, in relation to other operations around it.

    for example:

    var i = 0;
    if(i++) {
        //does this get run or not?
    }
    if(--i) {
        //and what about this one?
    }
    

    This is why Crockford considers it bad practice, and prefers the more explicit +=1.

    However, in general, I don’t have this kind of issue with ++; I’m perfectly happy to use it, and I would ignore JSLint telling me not to (most of the time!).

    This is the important thing about JSLint — it doesn’t tell you about actual errors; everything it tells you is a suggestion. Some of them are excellent suggestions (eg you should never ever use with); some are good suggestions that indicate poor code; and some of them are only a problem some of the time and should be considered individually. As a developer it is more important that you need to know why it’s making its suggesting than it is to actually fix them. Once you understand the reasons for them being pointed out, you are in a position to decide for yourself whether a given instance of it in your code is a problem or not and how to fix it.

    Hope that helps.

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

Sidebar

Related Questions

Possible Duplicate: Why avoid increment (“++”) and decrement (“--”) operators in JavaScript? I've heard
Possible Duplicate: How to avoid scientific notation for large numbers in javascript? Hi All,
Possible Duplicate: When should I use a javascript framework library? All, I'm fairly new
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: What Ruby IDE do you prefer? I've generally been doing stuff on
Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} What's the
Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C#
Possible Duplicate: How to avoid “!= null” statements in Java? Share your thoughts..
Possible Duplicate: Java floats and doubles, how to avoid that 0.0 + 0.1 +
Possible Duplicate: .NET Controls: Why aren’t all calls thread-safe? This question is not about

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.