lookup method

Option<V> lookup(
  1. K key
)

Return an Option that conditionally accesses map keys.

expect(
  { 'test': 123 }.lookup('test'),
  some(123),
);
expect(
  { 'test': 123 }.lookup('foo'),
  none(),
);

Implementation

Option<V> lookup(K key) => fromNullable(this[key]);