判断一个数组为[]或者对象是{}

xiaoxiao2021-02-28  86

function isEmpty(value) { return (Array.isArray(value) && value.length === 0) || (Object.prototype.isPrototypeOf(value) && Object.keys(value).length === 0); }
转载请注明原文地址: https://www.6miu.com/read-58232.html

最新回复(0)