cczlovexw
// js如何判断一个对象{}是否为空对象,没有任何属性
if (typeof model.rows === "object" && !(model.rows instanceof Array)){  
    var hasProp = false;  
    for (var prop in model.rows){  
        hasProp = true;  
        break;  
    }  
    if (hasProp){  
        model.rows = [model.rows];  
    }else{  
        throw "model.rows is empty object";  
        return false;  
    }  
}  

分类:

技术点:

相关文章:

  • 2021-11-27
  • 2021-12-07
  • 2021-12-07
  • 2021-12-07
  • 2021-12-07
  • 2021-12-07
  • 2021-12-07
  • 2021-10-16
猜你喜欢
  • 2021-10-16
  • 2021-10-16
  • 2021-12-07
  • 2021-12-07
  • 2021-10-16
  • 2021-12-07
相关资源
相似解决方案