We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78640d5 commit 9a7ebb8Copy full SHA for 9a7ebb8
MapExample.mo
@@ -0,0 +1,15 @@
1
+import Map "mo:core/object-oriented/Map";
2
+import Nat "mo:core/Nat";
3
+
4
+persistent actor Actor {
5
+ let map = Map.Map<Nat, Text>(Nat.compare);
6
7
+ public func main() : async () {
8
+ assert map.isEmpty();
9
+ map.add(1, "One");
10
+ assert map.get(1) == ?"One";
11
+ map.remove(1);
12
+ assert map.get(1) == null;
13
+ }
14
+};
15
+await Actor.main()
0 commit comments