DefinitelyTyped/hashmap/v1/hashmap-tests.ts
Andy 2f71174636 Restructure to support old versions (#13811)
* Restructure to support old versions

* Fix tests
2017-01-06 12:36:57 -08:00

23 lines
406 B
TypeScript

var map : HashMap<string, number> = new HashMap<string, number>();
map.set("foo", 123);
var value : number = map.get("foo");
map.has("foo");
map.remove("foo");
var keys : string[] = map.keys();
var values : number[] = map.values();
var count : number = map.count();
map.forEach(function(value : number, key : string) : void {
console.log(key);
console.log(value);
});
map.clear();