从对象中排除指定的键,返回不包含这些键的新对象
源对象的类型
要排除的键,必须是源对象的键之一
源对象
要排除的键名数组
不包含指定键的新对象
const user = { id: 1, name: "Alice", age: 25, password: "secret"};// { id: 1, name: "Alice", age: 25 }const safeUser = omit(user, ["password"]); Copy
const user = { id: 1, name: "Alice", age: 25, password: "secret"};// { id: 1, name: "Alice", age: 25 }const safeUser = omit(user, ["password"]);
从对象中排除指定的键,返回不包含这些键的新对象