How to fill a Javascript object literal with many static key/value pairs efficiently?

前端 未结 5 1793
-上瘾入骨i
-上瘾入骨i 2021-01-31 15:36

The typical way of creating a Javascript object is the following:

var map = new Object();
map[myKey1] = myObj1;
map[myKey2] = myObj2;

I need to

5条回答
提交回复
热议问题