过滤对象属性
代替Object.keys(target).filter()
const obj = { a: '', b: 123, c: 0, d: undefined, e: false, f: NaN, g: null };filterObj(obj); // { b: 123 }filterObj(obj, (v) => v !== undefined); // omit(obj, ['d']) 复制
const obj = { a: '', b: 123, c: 0, d: undefined, e: false, f: NaN, g: null };filterObj(obj); // { b: 123 }filterObj(obj, (v) => v !== undefined); // omit(obj, ['d'])
过滤对象属性
代替Object.keys(target).filter()