dherman / dictjs

Lightweight dictionaries for ES6

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dict.js

by Dave herman

Simple dictionaries with lightweight syntax, using ES6 features (proxies, weak maps).

Examples:

js> var d = new Dict({ foo: 17, bar: "hello world", baz: 42 });
js> Dict.size(d)
3
js> d.foo
17
js> "bar" in d
true
js> "hasOwnProperty" in d
false
js> d.hasOwnProperty = "yo dawg"
"yo dawg"
js> Dict.size(d)
4
js> delete d.baz
true
js> "baz" in d
false
js> d instanceof Dict
true
js> d instanceof Object
false

About

Lightweight dictionaries for ES6

License:Other