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.