skip to Main Content

hi guys I am niew would like to know why this is false,thanks

console.log(100 != 100);

I am not sure I would like to know I am very confused c !== is

Returns true if the expressions do not have the same value or the same type of value.
but it is Return sfalse.

2

Answers


  1. The != operator is used to check if two values are not equal. In this case, the values being compared are both 100. Since 100 is equal to itself, the expression evaluates to false.

    Login or Signup to reply.
  2. You should know the difference between != and !==.
    Former compare the value only, but latter compare the value and type of variable.

    For example

    var x=10;
    var y="10";
    
    console.log(x!=y) // false
    console.log(x!==y) // true
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search