javascript check if variable exists
snippet in javascript

javascript check if variable exists

user9744

if (typeof myVar !== 'undefined') {
    // myVar is defined
}