相关疑难解决方法(0)

如何在JavaScript中进行关联数组/散列

我需要使用JavaScript存储一些统计信息,就像我在C#中这样做:

Dictionary<string, int> statistics;

statistics["Foo"] = 10;
statistics["Goo"] = statistics["Goo"] + 1;
statistics.Add("Zoo", 1);
Run Code Online (Sandbox Code Playgroud)

JavaScript中是否有Hashtable类似的东西Dictionary<TKey, TValue>
我怎么能以这种方式存储价值?

javascript dictionary hashtable

548
推荐指数
9
解决办法
71万
查看次数

标签 统计

dictionary ×1

hashtable ×1

javascript ×1