javascript check with ? if variable exist before return code example
Example: javascript check if variable exists
if (typeof myVar !== 'undefined') {
// myVar is defined
}
if (typeof myVar !== 'undefined') {
// myVar is defined
}