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
Here's mine - returns true if value is null, undefined, etc or blank (ie contains only blank spaces):
function stringIsEmpty(value) { return value ? value.trim().length == 0 : true; }