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