I know there are two methods to determine if a variable exists and not null(false, empty) in javascript:
1) if ( typeof variableName !== \'undefined\' && v
if ( typeof variableName !== \'undefined\' && v
If you want to check if a variable (say v) has been defined and is not null:
if (typeof v !== 'undefined' && v !== null) { // Do some operation }
If you want to check for all falsy values such as: undefined, null, '', 0, false:
undefined
null
''
0
false
if (v) { // Do some operation }