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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:14:46+00:00 2026-05-20T22:14:46+00:00

Possible Duplicate: Javascript === vs == : Does it matter which “equal” operator I

  • 0

Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?

when i checked my code with JSLINT, it was full of errors…it works perfectly even in Ie6 but for some reason because i’m not an elegant coder i got more than 100 errors…

so i’d like to learn how to code better, error free… but when i used some suggestions JSLINT gave me like was to replace == with ===, well i did, and nothing was working…

so my question is: do we have to follow literally all the JSLINT suggestions?

  • 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-20T22:14:46+00:00Added an answer on May 20, 2026 at 10:14 pm

    JSLint tests a professional subset of Javascript, created by Douglas Crockford. Essentially, he seeks to carve only the “good parts” out of the JavaScript language, to make life for programmers easier and code more legible and predictable. So, the short answer is NO. You do not have to follow the instructions. Perfectly valid JavaScript code will, and does, fail JSLint all the time.

    But the long answer is that your life will be significantly easier in the long run if you do.

    Take === vs. ==, for example. The difference is testing for EQUALITY versus testing for IDENTITY. Or, as Crockford says in his book, JavaScript: The Good Parts:

    JavaScript has two sets of equality operators: === and !==, and their evil twins == and !=. The good ones work the way you would expect. If the two operands are the same type and have the same value, then === produces true and !== produces false. The evil twins do the right thing when the operands are of the same type, but if they are of different types, they attempt to coerce the values. The rules by which they do that are complicated and unmemorable.

    So, if you’re using === instead of ==, your code will almost always perform as you expect it to, a small price to pay for typing an extra character. But if you use == and the operands are not of the same type — a string and an integer, for instance, JavaScript will first translate those values to the same type, and then compare them. And they might not do what you want or what you expected. And since, in JavaScript, you’re often dealing with elements brought in from the DOM, which come in as strings, you run into string conversion issues all the time.

    As Crockford writes, here are some of the issues you could run into:

    '' == '0'   => false
    0 == ''     => true
    0 == '0'    => true
    
    false == 'false'    => false
    false == '0'       => true
    

    Screwy, eh? JavaScript: The Good Parts is a great book, super thin, and if you’ve been working with JavaScript for a while, it will change the way you code for the better. So will JSLint, if you bow your head like a good marine.

    So. Long answer? No. You don’t have to do everything JSLint tells you. But you should.

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

Sidebar

Related Questions

Possible Duplicate: Javascript === vs == : Does it matter which “equal” operator I
Possible Duplicate: Javascript === vs == : Does it matter which “equal” operator I
Possible Duplicate: Javascript === vs == : Does it matter which “equal” operator I
Possible Duplicate: Escape string for use in Javascript regex I have a msg like
Possible Duplicate: Is it worth it to code different functionality for users with javascript
Possible Duplicate: How to detect if JavaScript is disabled? I have a website which
Possible Duplicate: JavaScript scope and closure What is this for? (function(){ //The code to
Possible Duplicate: Javascript: find the time left in a setTimeout()? I'm trying to use
Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} What's the
Possible Duplicate: JavaScript data formatting/pretty printer I am getting a bit tired of looking

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.