1.0.0 • Published 5 months ago

@postinumero/map-get-with-default v1.0.0

Weekly downloads
126
License
ISC
Repository
github
Last release
5 months ago

@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'