@postinumero/map-get-with-default

0.2.0 • Public • Published

@postinumero/map-get-with-default

Example

import get from '@postinumero/map-get-with-default';

const map = new Map();

// Using the proposed bind operator (::) (https://github.com/tc39/proposal-bind-operator)
console.log(map::get('x', () => 'foo')); // => 'foo'

console.log(get(map, 'x', () => 'foo2')); // => 'foo'

console.log(map.get('x')); // => 'foo'

Readme

Keywords

none

Package Sidebar

Install

npm i @postinumero/map-get-with-default

Weekly Downloads

253

Version

0.2.0

License

ISC

Unpacked Size

2.18 kB

Total Files

5

Last publish

Collaborators

  • arnosaine