import { pick } from "https://deno.land/std@0.222.1/collections/mod.ts";
Creates a new object by including the specified keys from the provided object.
Examples
Example 1
Example 1
import { pick } from "https://deno.land/std@0.222.1/collections/pick.ts";
import { assertEquals } from "https://deno.land/std@0.222.1/assert/assert_equals.ts";
const obj = { a: 5, b: 6, c: 7, d: 8 };
const picked = pick(obj, ["a", "c"]);
assertEquals(picked, { a: 5, c: 7 });
Type Parameters
K extends keyof T