if((Array.isArray(变量) && 变量.length === 0) || (Object.prototype.isPrototypeOf(变量) && Object.keys(变量).length === 0)){ alert('该方法判断了{}花括号这种情况!'); }
参考-https://blog.csdn.net/weixin_33984032/article/details/92285417