Skip to content

values() function

オブジェクトの列挙可能な文字列キーのプロパティ値のイテレータを返します。

Signature:

typescript
declare function values<T extends Record<string, any>>(
  obj: T,
): Generator<T[Extract<keyof T, string>], void, unknown>;

Example

ts
[...values({ a: 1, b: "2", c: true })];
// [1, "2", true]

Open Source Code

Released under the Apache-2.0 License.