[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • 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

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

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