Creates a new object by excluding the specified keys from the provided object.
The type of the object.
The type of the keys to omit.
The object to omit keys from.
The keys to omit from the object.
A new object with the specified keys omitted.
import { omit } from "@std/collections/omit";import { assertEquals } from "@std/assert";const obj = { a: 5, b: 6, c: 7, d: 8 };const omitted = omit(obj, ["a", "c"]);assertEquals(omitted, { b: 6, d: 8 }); Copy
import { omit } from "@std/collections/omit";import { assertEquals } from "@std/assert";const obj = { a: 5, b: 6, c: 7, d: 8 };const omitted = omit(obj, ["a", "c"]);assertEquals(omitted, { b: 6, d: 8 });
Creates a new object by excluding the specified keys from the provided object.