Returns the first value in the given object. Follows the default object iteration order.

Type signature

<T>(xs: GenericObject<T>) => T | undefined

Examples

first({ a: 1, b: 2, c: 3 });
// ⇒ 1
Try in REPL

Questions

  • How to get the first value of an object?

TypeScript sourceJavaScript source