javascript判断对象是否为undefined

if (typeof(obj) == 'undefined') {
    alert('123');
}

if (obj == undefined) {
    alert('123');
}

更多推荐