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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:57:55+00:00 2026-06-07T18:57:55+00:00

I am using this code in JSLint var string = Hello; if (string ==

  • 0

I am using this code in JSLint

var string = "Hello";
if (string == "Hello") {
    string = "World";
}

And I am getting this error

Expected '===' and instead saw '=='.
if (string == "Hello") {

Why JSLint is throwing this error?

  • 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-07T18:57:57+00:00Added an answer on June 7, 2026 at 6:57 pm

    From JSLint docs under == and !=

    The == and != operators do type coercion before comparing. This is bad
    because it causes ‘ \t\r\n’ == 0 to be true. This can mask type
    errors. JSLint cannot reliably determine if == is being used
    correctly, so it is best to not use == and != at all and to always use
    the more reliable === and !== operators instead.

    If you only care that a value is truthy or falsy, then use the short
    form. Instead of

    (foo != 0)

    just say

    (foo)

    and instead of

    (foo == 0)

    say

    (!foo)

    There is an eqeq option that allows the use of == and !=.

    How to tell JSLint not to throw this error.

    Use JSLint directive eqeq

    like this

    /*jslint eqeq: true*/
    

    So the full code will look like

    /*jslint eqeq: true*/
    var string = "Hello";
    if (string == "Hello") {
        string = "World";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this code var html='<div class=somediv></div>'; var target=document.getElementById('contentArea'); target.appendChild(html); I'm getting Uncaught Error: NOT_FOUND_ERR:
Using this code $.getJSON(http://mydomain.com/getcustomers?callback=?,function(data) { .... }).error(function(err){ .... }) I'm getting jQuery16103492487950357067_1336742910384 was not
Im using this code: protected String getContactInfo() { Cursor cursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, null,
Im using this code for mysql connection $con = mysql_connect(localhost:/var/lib/mysql/mysql.sock, abc , xyz); if
While using this code to serialize an object: public object Clone() { var serializer
When using this code (simplified for asking): var rows1 = (from t1 in db.TABLE1
Using this code: var pendingRequest = new Ajax.Request(myUrl, { method: 'post', postBody: soapMsg, contentType:
Using this code causes a Bus Error. Can someone point out what is wrong
In using this code (adapted from here ) I get the following error: The
Using this code v=new Date(); var bxx=document.getElementById('bxx'); function t(){ n=new Date(); ss={time}; s=ss-Math.round((n.getTime()-v.getTime())/1000.); m=0;h=0;

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.