@lvchengbin/map

0.0.13 • Public • Published

Map

An implementation of Map in JavaScript for browsers. Supporting methods of Map in ES6.

Usage

$ npm i @lvchengbin/map --save
import Map from '@lvchengbin/map';
const map = new Map( [ [ 'x', 1 ], [ 'y', 2 ] ] );
map.set( {}, 3 );

The native Map will be used if the client supports native Map and if the second argument of Map constructor is not false.

If you want to use the library in browsers that loading with <SCRIPT> tag, you can git it from map.js, and for browsers do not support ES6, please use map.bc.js.

<script src="./map.bc.js"></script>
<script>
var map = new Map( [ [ 'x', 1 ], [ 'y', 2 ] ] );
console.log( map.size );
</script>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.13
    2
    • latest

Version History

Package Sidebar

Install

npm i @lvchengbin/map

Weekly Downloads

15

Version

0.0.13

License

MIT

Unpacked Size

22.7 kB

Total Files

9

Last publish

Collaborators

  • lvchengbin