本文介绍了如何将新的关联数组添加到现有的关联数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想知道是否有人知道如何将新的关联数组添加到现有的关联数组中,这是我已经拥有的内容

我有一个包含此值的变量myAray

Hi guys i was wondering if anyone of you knows how to add a new associative array to an existing associative array here''s what i already have

I have a variable myAray which contains this value

myArray["-" + 1] = [{ title: "title 1", key: "1", property: "new"}];
myArray["-" + 2] = [{ title: "title 2", key: "2", property: "old"}];
myArray["-" + 3] = [{ title: "title 3", key: "3", property: "modify"}];
myArray["-" + 4] = [{ title: "title 4", key: "4", property: "few"}];
myArray["-" + 5] = [{ title: "title 5", key: "5", property: "other property"}];
myArray["-" + 6] = [{ title: "title 6", key: "6", property: "streaming"}];



如您所见,我的myArray变量现在只有6个内容,我想在其中添加一个新的关联数组,其值为this



as you can see i only have 6 content for my myArray variable now i would like to add a new associative array in it with a value of this

myArray["-" + 7] = [{ title: "New inserted array", key: "7", property: "newly created"}];



但是我该怎么做到呢?我已经尝试过使用myArray.push了,但是并没有解决我的问题.



but how do i accomplish that? i already tried using myArray.push but that didnt solve my problem

推荐答案


这篇关于如何将新的关联数组添加到现有的关联数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 02:09