only

Commons
stable

Extract a strict subset of an object's keys into a new object. Unlike pick, every listed key is copied unconditionally — the result contains all listed keys, even when they are undefined on the source.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

obj
requis
T
The source object to extract properties from.
include
requis
Array<U>
Array of key names to copy into the output. Each key is iterated and set on the clone regardless of whether it exists on the source.

API

Valeur de retour

La valeur retournée par cet util.

A new object containing only the listed keys and their values from the source.

Usage

Exemples

Extraits de code prêts à coller.

Extract specific keys

typescript