Link to home
Start Free TrialLog in
Avatar of kneidels
kneidels

asked on

IsNull equivalent in ASP/jScript

hey folks

i usually code in VBscript and use IsNull - i understand the function does not exist in Jscript. what can be used instead?

(i am checking a database value - but its a general question too)

thanks!
Avatar of Bardobrave
Bardobrave
Flag of Spain image

Js has better aproach to Null management that VB in general lines... usually you cant evaluate a null value in VB, however, in Js a Null value can be evaluated to False without getting errors, this is because in Js all that is not True is always False, as Null can't be True it's automatically set to False when evaluated.

Also you can use a statement like (object == null) if you are not used to evaluate directly an object
Avatar of kneidels
kneidels

ASKER

thanks
wasnt sure exactly what you meant
i landed up using the length which seemed to help.

should that give the same indication?
ASKER CERTIFIED SOLUTION
Avatar of Göran Andersson
Göran Andersson
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
great - thanks!