Answers for "js check if is set"

15

javascript check if variable exists

if (typeof myVar !== 'undefined') {
    // myVar is defined
}
Posted by: Guest on July-23-2019
1

javascript check if set

if (typeof variable !== 'undefined') {
    // the variable is defined
}
//or
if (typeof variable === 'undefined') {
    // variable is undefined
}
Posted by: Guest on March-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language