当我尝试检查 [action] 是否已定义时,我不断收到 javascript 错误。
if((typeof array_from_php.api_description[mobile_type][action]) != 'undefined') {
console.log('defined');
api = array_from_php.api_description[mobile_type][action];
} else {
console.log('undefined');
mobile_type = 0;
api = array_from_php.api_description[mobile_type][action];
}
错误:未捕获的类型错误:无法读取未定义的属性“register_mobile”