E
E
Egor Mikheev2015-10-30 13:26:42
JavaScript
Egor Mikheev, 2015-10-30 13:26:42

How can you combine multidimensional arrays in JS?

Hello, there are 2 arrays, both are multidimensional.
What's the easiest way to merge these arrays?

one)

var options = {
render: render,
attributes: {
"ВсегоКвартирДиап": derivers("всегоКвартир", 50)
 },


2)

var tempQuery = {         
  "rows": [
    "компания",
    "имяУправляющего",
    "телефон"
  ],
  "exclusions": {
    "улица": [
      "Бабушкина  ул",
      "Банбана  ул",
      "Береговая  ул" ]
}};


I tried Jquery MERGE, but something did not work out, maybe this function, like concat in js, does not merge multidimensional arrays?.
$.merge(options,tempQuery);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita K., 2015-10-30
@ogregor

These are not arrays, but objects to combine, you can use the jQuery function
$.extend(options,tempQuery)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question