Is there a universal JavaScript function that checks that a variable has a value and ensures that it\'s not undefined or null? I\'ve got this code,
undefined
null
It may be usefull.
All values in array represent what you want to be (null, undefined or another things) and you search what you want in it.
var variablesWhatILookFor = [null, undefined, '']; variablesWhatILookFor.indexOf(document.DocumentNumberLabel) > -1