//key为string , value为number
var map: { [key: string]: number; } = {
"t" : 3,
"o" : 5,
"g" :10
};
for(let k in map){
console.log(map[k]);
//key为string , value为number
var map: { [key: string]: number; } = {
"t" : 3,
"o" : 5,
"g" :10
};
for(let k in map){
console.log(map[k]);
本文标题:typescript中使用字典Dictionary
本文链接:https://www.haomeiwen.com/subject/tcpzohtx.html
网友评论