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

Type signature

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

Examples

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

Questions

  • How to get the last value of an object?

TypeScript sourceJavaScript source