Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A simple map from strings to values in JavaScript
JavaScript
branch: master
Failed to load latest commit information.
test Fixed bug in hasKey(), added a unit test for it.
.gitignore first commit
README.md first commit
strmap.js

README.md

A simple map from strings to values in JavaScript

This implementation avoids the pitfalls of directly using objects for this purpose.

Usage on Node.js (on browsers, you need an AMD-compatible script loader such as RequireJS):

> var strmap = require("./strmap");
> var map = new strmap.StrMap({ foo: 1, bar: 2});
> map.get("foo")
1
> map.set("foo", "abc")

Tests

Something went wrong with that request. Please try again.