2
if (description !== undefined)

i found this in nerd dinner tutorial.

Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
  • 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
  • 377,238
  • 77
  • 533
  • 578
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
  • 68,820
  • 20
  • 127
  • 125
Subhash Dike
  • 1,836
  • 1
  • 22
  • 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,068
  • 10
  • 30
  • 42