Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Javascript array question

I have an array A filled with N other arrays. How do I insert an array x into the end of the (lets say) third array in A without concatenating them. (The third array of A is supposed to be one element longer).
0
mdoland
Asked:
mdoland
1 Solution
 
Luis PérezSoftware Architect in .NetCommented:
Can you post some of your code or be more explicit?

Anyway, you can always call the .push method of the array to add anything to it. I.e.:

myArray.push(newElement);

If you have an array containing other arrays, you should do:

myArray[2].push(otherArray);

I don't know if this is what you want to do. Hope that helps.
0
 
mdolandAuthor Commented:
Perfect, somehow I got it concatenated. Very frustrating.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now