标签: javascript websocket
我有一个JavaScript数组
var clients = []; clients["one"] = 1; clients["two"] = 2; clients["three"] = 3;
原始输出
[one: '1', two: '2', three: '3']
我试图将其转换为 JSON.stringify(clients) ,我得到了一个像这样的空对象
[]
我可以做些什么来获得JSON对象呢?