js判断变量是否存在

tech2025-06-06  11

if (typeof (data) != "undefined")

注:只能判断一层变量,例如:data。如果data不存在不能判断data.code,会导致报错。

最新回复(0)