解决方法
是的,您可以使用对象或数组文字语法或对象/数组方法创建该类型的数组.
数组:
// Using array literal grammar var arr = [[value1,value3],[value1,value2]] // Creating and pushing to an array var arr = []; arr.push([value1,value3]);
数组的对象:
// Using object literal grammar var obj = { "key": [value1,"key2": [value1,value2] } // Creating object properties using bracket or dot notation var obj = {}; obj.key = [value1,value3]; obj["key2"] = [value1,value2];