📅  最后修改于: 2022-03-11 15:02:57.527000             🧑  作者: Mango
if (typeof variable !== 'undefined') {
// the variable is defined
}
//or
if (typeof variable === 'undefined') {
// variable is undefined
}