5

Possible Duplicate:
Best way to check for “undefined” in JavaScript?

I want to make an if statement that if the value is not defined then let it go through.

I tried

if (something != "undefined")

and

if (something !== "undefined")

However it seems to go into the if statement no matter what. If it is undefined it goes through. If it is defined it goes through. Am I doing something wrong?

Community
  • 1
  • 1
chobo2
  • 83,322
  • 195
  • 530
  • 832
  • 1
    A more complete answer is here: http://stackoverflow.com/questions/3390396/best-way-to-check-for-undefined-in-javascript/3390426#3390426 – makerofthings7 Nov 02 '10 at 22:11

0 Answers0