0

I have two multidimensional arrays that I would like to be one multidimensional. I have tried to use push but I'm sure I missing something, because Array1 only get a undefined into it. Anyone there can help?

var Array1 = Array( { Felt: "#Field1", Validering: "min", Krav: 2, SpanID: "#span1" },
                { Felt: "#Field2", Validering: "min", Krav: 2, SpanID: "#span2" },
                { Felt: "#Field3", Validering: "lig", Krav: 10, SpanID: "#span3" },
                { Felt: "#Field4", Validering: "min", Krav: 6, SpanID: "#span4" },
                { Felt: "#Field5", Validering: "min", Krav: 6, SpanID: "#span5" },
                { Felt: "#Field6", Validering: "min", Krav: 1, SpanID: "#span6" });

var Array2 = Array( { Felt: "#Field7", Validering: "min", Krav: 2, SpanID: "#span7" },
                    { Felt: "#Field8", Validering: "min", Krav: 2, SpanID: "#span8" },
                    { Felt: "#Field9", Validering: "lig", Krav: 10, SpanID: "#span9" },
                    { Felt: "#Field10", Validering: "lig", Krav: 10, SpanID: "#span10" },
                    { Felt: "#Field11", Validering: "lig", Krav: 11, SpanID: "#span11" });

UPDATE: I used this solution:

Array1 = Array1.conat(Array2);

1 Answer 1

0

Want to join arrays? Use Array.concat() method

Array.concat(Array1, Array2);
console.log(Array1);
1
  • Maybe a stupit question, but how can I close this thread, and let you get the credits?? Commented Mar 8, 2014 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.