2
if (description !== undefined)

i found this in nerd dinner tutorial.

Andreas Köberle
  • 98,250
  • 56
  • 262
  • 287
  • 2
    Related question: http://stackoverflow.com/questions/359494/javascript-vs-does-it-matter-which-equal-operator-i-use – Drazar Jan 28 '11 at 07:58

3 Answers3

4

It is identity operator that not only checks for value but also type.

Example:

if (4 === 4)  // both type and value are same
{
  // true
}

but

if (4 == "4")  // value is same but type is different but == used
{
  // true
}

and

if (4 === "4")  // value is same but type is different but === used
{
  // false
}

You should use === or !== once you are sure about both value and type.

Sarfraz
  • 367,681
  • 72
  • 526
  • 573
2

This is the strict not equal operator and only returns a value of true if both the operands are not equal and/or not of the same type. The following examples return a Boolean true:

a !== b 
a !== "2" 
4 !== '4' 

For more operator information refer here Dev Guru Forum

aaronasterling
  • 65,653
  • 19
  • 122
  • 125
Subhash Dike
  • 1,806
  • 1
  • 23
  • 37
1

This is the strict not equal operator and only returns a value of true if both the operands are not equal and/or not of the same type.

Fredrik Widerberg
  • 3,050
  • 10
  • 29
  • 42