javascript Map~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// JavaScript Code
$(document).ready(function(){
var map = new Map();
map.put(“zzz”,”123”);
alert(map.get(“zzz”));
});
function Map(){
this.map = new Object();
}
Map.prototype = {
put : function(key, value) {
this.map[key] = value;
},
get : function(key) {
return this.map[key];
}
}
This article is licensed under CC BY 4.0 by the author.