Answers for "js if is set"

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
1

isset js

if (typeof obj.foo !== 'undefined') {
}
Posted by: Guest on September-07-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language